Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
multiprocess c/c++ linux
anyone know a guide/tutorial on how to multiprocess programming in linux?
for example I have a main qwidget that has 2 button(date, time). When "date" button is click, it open a new qwidget window that display date but instead running on same process, this widget will run on child process.
should i use something like fork() to run this "date qwidget" any example how this is done?
Out of curiosity, why do you want to do that ?
JonB last edited by
fork()will be a suitable approach, unless you really know what you are doing!
Pablo J. Rogina last edited by
Is this widget going to do some heavy processing on its own? If so, I'd say it shouldn't and you would need to consider such calculations into threads.
Most of the Qt apps keep all the GUI components in just one thread, the GUI thread.
its an assignment, so..
well i try tread, and it got slower, not sure its the mutex or sync operation behind it. also its assignment so i need use multi process.
Multiple threads don't guarantee that your application will go faster. It all depends on what it must do.
Multiple threads don't guarantee that your application will go faster. It all depends on it must do.
i know which is way i'm try to figure out if i run in multporcess mode will it be faster.
It will only be faster if the tasks that is heavy can be split between threads.
so data can be calculated in parallel.
Else it will make little difference besides not locking up the gui while it processes.
Since you are showing zero code, all we can do it give general suggestions.
Also note , its NOT possible to move QWidgets to other threads. They must live in main thread.