How to schedule multiple infinitely running processes in linux, in C
Hi Everyone,
I need a way to schedule multiple (to be precise three different processes) infinitely running processes that I am creating to be scheduled initially and then later they may run in parallel fashion.
The code is something like this:
int main()
{
fork() //forking the main process
if (parent)
//will invoke the signal handler for Ctrl+C, for killing all childs
if (child)
{
fork() //fork again
if(parent1)
// run 1st infinite process
else // if child1
fork() //fork again
if(parent2)
//run 2nd infinite process
else //when child2
//run 3rd infinite process
}
}
I need process1 to start first and then process2 should get started and then process3. Later they may run parallel !
|