Component index
Section index | Component forktmp |
Search |
Type | Function |
Summary | fork a subprocess and communicate with the parent |
Description | A packaged solution to simplify forking a child process and retrieving results. This is done while being compatible with the GUI (other UI thread are still alive). This component is generally using along with the SHAREMEM template allowing the creation of shared memory area so the child and parent may exchange information. |
![]() ![]() | void joining (int state, bool &end) | |
![]() ![]() | void message (bool &end) | |
![]() ![]() | void task () | |
![]() ![]() | void timeout (bool &end, int duration) |
Execute a sub-process and retrieve results. Return -1 if it failed to start the sub-process
Execute a sub-process and retrieve results. Return -1 if it failed to start the sub-process
Execute a sub-process and retrieve results. Return -1 if it failed to start the sub-process
This is executed in the parent process
forktmp optionally accepts a PRIVATE_MESSAGE argument. When a signal is sent to this message, the functag is called. The default behavior is to end the component.
The forktmp accept a timeout argument (in seconds). The functag is called whenever the timeout is reach. The functag must decide if the component must end. The default behavior is to end the component.
The join fhelper ends when the parent joining functag end. This is generally used to notify the parent of some event (a value is now available in shared memory for example).