Hello, a9000, you wrote: A> That to me of it is not clear - how better to do of all. That is whether to take Qt, or there are indirect libraries (the project is written on Qt so it is logical to look on Qt - but if for the given task there is something superficial indirect why and is not present). Here my general answer to a subject that it is necessary to take Re: the Question on a multithreading for a C ++ the project the Author: velkin Date: 05.07.16. A> If Qt, whether that is enough for job transmission to use signals and slots, or not. How much signals and slots decelerate code performance in comparison with performance without message passing between flows? There not in flows business, the slot can be caused as function With ++, than it and is, and it is possible by means of the metaobjective system, that is as the slot. As Qt after code generation uses a pure C ++ after project start it is possible to look that he in files and to count in how many it is all gets. But on the other hand from the programmer it is not necessary any special efforts for usage of this technology. A> the ready component or a ready example with the code is necessary to me, able to do following A> 5. On termination of "job" performance to notify the sender was specific this job on that that all is ready Once again short the message under the link. Modes of work with execution flows in Qt: http://doc.qt.io/qt-5/threads-technologies.html 1) QThread: Low-Level API with Optional Event Loops 2) QThreadPool and QRunnable: Reusing Threads 3) Qt Concurrent: Using a High-level API To begin with it is better to read here it, there two approaches of the first mode of work with flows, by means of signals-SLOTS with usage moveToThread and by means of inheritance QThread with redefinition of a method (polymorphism). http://doc.qt.io/qt-4.8/qthread.html http://doc.qt.io/qt-5/qthread.html If does not suffice, in Qt there is a demo, in QtCreator or other editor it is possible to include search in files and to find under text QThread ready examples. It is possible to download to a heap of examples for books to the Breast-band, Blanshet/Sammerfild and so on. The second method is thread pool: http://doc.qt.io/qt-5/qthreadpool.html http://doc.qt.io/qt-5/qrunnable.html it is possible for your task approaches better, than QThread. As a matter of fact all too most, but in the form of a template of designing "thread pool". Gives thread pool for handling of the jobs presented normally in the form of queue. https://en.wikipedia.org/wiki/Thread_pool_pattern and the third method: http://doc.crossplatform.ru/qt/4.8.x/ht
rrent.html In the link the table http://doc.qt.io/qt-5/threads-technologies.html is painted more that it is necessary to select how to use and all something like that, but this one and too, so to say with . If there will be something more difficult, access to the same data from different flows, that is other classes, besides QThread or QThreadPool with QRunnable. http://doc.crossplatform.ru/qt/4.8.x/ht
reads.html I not so would like to retell by the own words when there is a normal documentation. We present application was started and it automatically has a principal flow of execution, differently anything would not work. And by means of QThread we can create still a flow or in case of other classes flows. And they start to work parallely, that is or on different kernels of the processor or on one, but there is no need behind it somehow especially to track. There are control functions, it is possible to stop this additional flow, to launch and so on. And here one of our functions will work in other flow, here there and the executable code will be placed. And even if it tightly hangs up, the main flow will work all the same, that is all will work. Depends on specific implementation, but as a whole it will be necessary to connect the slot of the beginning and a signal of end of operation to controlling program, it is possible to start on button click at which too there are actuating signals, on end the signal from a flow leaves the automatic machine. Is as standard examples showing how to make progress display, that is the additional flow works, transfers the message signals about progress, for example, to the core for display. Flows have identifiers how much I remember the same QtCreator it is all shows during a debug mode. In general I recommend to read the documentation, at least under links in this comment and all becomes clear. And it is even better to launch the code and there to experiment.