Learning multithreaded programming

Looking through vacancies for the position of C / C++ programmer, I noticed that knowledge of syntax, OOP and algorithms is not enough. In most cases, the so-called "multithreaded programming"is added to the above. I found out that there are many technologies.

  • On the one hand, there is Qt, in which this topic is probably somehow beaten.
  • On the other hand, there is a very popular OpenMP
  • There is still a boost/Thread, and the the word boost is as common in job openings as "multithreaded programming"

I have already seen a lot of questions in the style of " What to read? What sites do you recommend?". I would like to know which technologies are the most relevant today. The same selection criterion is the complexity. MFC also implements multithreading, but to do this, you need to learn WinAPI, then MFC, then you can start directly with multithreading. In addition, it is not a fact that the front-end skills will come in handy.

To summarize all of the above: I would like to choose the current technology, the basics that can really be comprehended in a week of active and persistent study. Thank you in advance!

Author: Grundy, 2013-03-14

1 answers

Probably, it is necessary to understand what threads are in general, how they are created, how they can be interrupted, how they end. Next, the most difficult thing is the synchronization mechanisms: all sorts of mutexes, semaphores, barriers, conditional variables. First, analyze and implement the "producer-consumer" pattern (producent-consumer). Then much will become clear.

It is probably better to start with low-level implementations, from the API level of the system. Different boost.Thread, C++11 Thread, Qt:: Thread-OOP wrappers, convenient and more secure, but rather transparently reflecting low-level implementation principles.

What to read... Usually, books on the OS API describe all this. For general questions, Tannenbaum has a pretty good section in the OS book. There is a book on C++11 Thread, including in Russian.

 8
Author: skegg, 2013-03-14 22:09:57