P
Peter Lom
Hi,
please advise on the following.
Need to implement execution of tasks in serial and parallel mode
together with daemons within Ruby.
Scenario:
The main program starts with a fork - it executes in the child process
some background programs in the strict sequence - need to leave this
child process running as a daemon.
When the last program announces that it finished init stage, it writes a
notice to the stdout (I cannot modify this notice but I know what is
it);
- how to advise the parent that all is ready?
I use Program.detach to continue in the main - all is OK but I don't
know when the last daemon finishes init and wrote that notice (use of
sleep works but is ugly)
When the parent knows all is ready, it should start launching new set of
tasks in serial or parallel mode.
I execute serial tasks in a separate thread and all works OK.
How can the parent know if parallel tasks finished?
Do I need semaphores/mutexes etc to organise this?
Many thanks
Peter
please advise on the following.
Need to implement execution of tasks in serial and parallel mode
together with daemons within Ruby.
Scenario:
The main program starts with a fork - it executes in the child process
some background programs in the strict sequence - need to leave this
child process running as a daemon.
When the last program announces that it finished init stage, it writes a
notice to the stdout (I cannot modify this notice but I know what is
it);
- how to advise the parent that all is ready?
I use Program.detach to continue in the main - all is OK but I don't
know when the last daemon finishes init and wrote that notice (use of
sleep works but is ugly)
When the parent knows all is ready, it should start launching new set of
tasks in serial or parallel mode.
I execute serial tasks in a separate thread and all works OK.
How can the parent know if parallel tasks finished?
Do I need semaphores/mutexes etc to organise this?
Many thanks
Peter