You are not logged in.

#1 2015-12-26 16:59:08

h9k
Member
Registered: 2012-08-04
Posts: 7

C++11 multithreading - books, tutorials etc.

Hello,
I am trying to learn something about multithreading in general and C++'s implementation in particular but it ain't going well ;-)
I am reading Stroustrup's book http://www.stroustrup.com/4th.html and don't know is it his writing style or I am just plain stupid but I can't understand most things he is talking about when it comes to this subject.

Someone can recommend me a book or tutorial or whatever where there is clear explanation what is logical connection between "promise and future" besides the fact that

std::future<T> get_future();
(since C++11)
Returns a future object associated with the same shared state as *this.

http://en.cppreference.com/w/cpp/thread … get_future
etc ;-)

Offline

#2 2015-12-28 20:32:36

memory_leak
Member
Registered: 2015-03-02
Posts: 43

Re: C++11 multithreading - books, tutorials etc.

If you want to learn C++, you might wish to take a look at C++ Primer by Lippman http://www.amazon.com/Primer-5th-Editio … 0321714113
or C++ Primer Plus by Prata http://www.amazon.com/Primer-Plus-Editi … 0321776402

Stroustrup might have invented the language, but his writing is sometimes a tad too academic. Personally I have no problems reading him, but I do think he can be a bit tedious at moments.

Those are generic books on C++. Multithreading has become a part of C++ standard realtively late so there are (yet) not so many very good books on the subject. There are probably few around, but for the most part you will find only a chapter or two on multithreading in various books. The situation will probably soon change, but at the moment if you just want to learn abou multithreading you might wish to look into some of numerous books on topic with Java. Multithreading has been part of Java since very beginning, and thus there is more quality literature on subject written for Java. For free resources I suggest you to take a peek at posix threads, there are tons of tutorials online.

One particular book on C++ is "C++ Multithreading Cookbook" published by Packt, It contains a lot of relatively easy accessible short articles about different topics, or you might wish to explore some online tutorials on the C++11 threads as a starter,

Topics of multithreading is otherwise huge, there are books about highly parallell programming on GPUs (cuda, opencl), or concurency and multitasking (for IO and network programming) and for solving problems in parallell on different cpus. "Professional Multicore Programming - Design and implementation for C++ Developers" is an interesting book published by Wiley, as well as a little bit older "Parallelll computing" published by Addison Wesley and even older "Foundations of Multithreaded, Parallel and Distributed Programming". Of course, a must read is classic by David Tannenbaum: "Structured Computer Organization" http://www.amazon.com/Structured-Comput … 0132916525 - not exactly a book about multithreading, but if you are new to programming, this one is really a cornerstone and also very pleasurable read for a computer science book.

Offline

#3 2015-12-28 23:31:30

mpan
Member
Registered: 2012-08-01
Posts: 1,207
Website

Re: C++11 multithreading - books, tutorials etc.

@h9k
Actually it might be very informative to read Java's docs on the similarly named features and peek some usage examples for the Java's version (for example on StackExchange). While, of course, exact method of applying the classes will be different, and C++'s threading library offers the facilities under different names or doesn't provide them at all, the overall purpose and model is very similar. Getting a high-level view of what's going on might be what you're missing now for comprehending the multithreading in C++.


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#4 2015-12-29 18:08:42

h9k
Member
Registered: 2012-08-04
Posts: 7

Re: C++11 multithreading - books, tutorials etc.

Hi guys

Thank you for your reply,

https://www.youtube.com/playlist?list=P … 0FC78FF8BE

I've found this and although pace is quite slow it looks like it's good start, that guy seems to know what he is talking about and he isnt lost in technical details ergo he can actually explain this things ;-)

Cheers.

Offline

#5 2015-12-31 17:49:14

The Infinity
Member
Registered: 2014-07-05
Posts: 91
Website

Re: C++11 multithreading - books, tutorials etc.

Threading is a new feature in the C++ standard library and hence there is not a lot of documentation available. Threading (especially with the standard lib) often involves usage of std::bind and/or lamda functions so I'd propose you should cover these topics first if you haven't already.

3rd party libs such as Qt also provide threading support for C++. Especially Qt provides a  lot of functionality (much more then the standard library) and has a very detailed and current documentation with lots of examples. (However, the downside of Qt is that it is a very big and complex library which likely includes a lot of features you don't need. I wouldn't use Qt just to start a new thread.)
http://doc.qt.io/qt-5/thread-basics.html
http://doc.qt.io/qt-5/threads-technologies.html

Offline

#6 2016-03-14 20:15:04

rahulgupta4u
Member
Registered: 2016-03-14
Posts: 2

Re: C++11 multithreading - books, tutorials etc.

In google I have found this link on Multithreading in C++. Mentioned lot of theory and cases.

https://www.tutorialcup.com/cplusplus/m … eading.htm

Offline

Board footer

Powered by FluxBB