You are not logged in.

#1 2023-11-16 16:32:33

snack
Member
From: Italy
Registered: 2009-01-13
Posts: 874

Multithreading in C++: stdlib or TBB?

I'm totally new to multithreading in C++, I just read something about the standard library approach (future, promise et al.) and about Intel TBB. I don't have a clear idea of the advantages of one approach vs the other; the mean-squared-opinion on the web seems to be in favor of TBB but I couldn't find an apple-to-apple comparison (maybe because they're different things?). So if there's anybody willing to help me with this before I start my experiments it could be of great help.
Thanks in  advance.

Offline

#2 2023-11-17 11:28:20

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,926

Re: Multithreading in C++: stdlib or TBB?

https://en.wikipedia.org/wiki/List_of_C … _libraries indicates there are a lot more choices then just two .

Do you have previous experience with multithreaded programming ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2023-11-17 15:12:15

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,111
Website

Re: Multithreading in C++: stdlib or TBB?

Lone_Wolf wrote:

Do you have previous experience with multithreaded programming ?

I do. Which is why I use Rust for it now.
https://bholley.net/blog/2015/must-be-t … -code.html

Last edited by schard (2023-11-17 15:12:40)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#4 2023-11-17 17:14:49

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,418
Website

Re: Multithreading in C++: stdlib or TBB?

TBB is mostly useful if you need special features like flow graphs or work scheduling. Otherwise the standard library is fine.

The following book (though somewhat dated) gives a good comparison between different methods:

https://books.google.com/books/about/St … edir_esc=y


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#5 2023-11-20 06:33:19

snack
Member
From: Italy
Registered: 2009-01-13
Posts: 874

Re: Multithreading in C++: stdlib or TBB?

Thanks to everybody. As I wrote I am an absolute beginner with MT, I just read the multithreading section of Stroustrup's book and starting to experiment. I'll go through the references you provided. I am bound to C++ for the time being so I'll give Rust a look in a later stage.

Offline

Board footer

Powered by FluxBB