making the parent direct child processes to pause/sleep and resume execution
Hi.
this is the algorithm am trying to implement to control Load average.I am having problems waking up selected sleeping child processes.Am using signals. As soon as the load is greater than the desired load,the parent sends a SIGUSR1 to a child process which in turn invokes a function that causes the child to sleep.after this,the program terminates.How do i make the parent process resume control and wakeup sleeping processes or make more child processes go to sleep depending on whether the load is lesser or greater than a desired load?. thanks. Code:
main() |
here, "job",is just some junk activity to generate load.In my case,i accept a number(the first line of the algorithm) and compute either the number^number^number..(for example:if number is 3,i calculate 3^3^3^3,if its 2,i calculate 2^2^2)..or the factorial of the number..
|
All times are GMT -5. The time now is 01:51 PM. |