in reply to Efficient way to fork processes and keep a running count?
Otherwise, you could implement a simple queue - each child fetches the next number from the queue, reads that disk, and repeats until the queue is empty. You could use a file or a database table for the queue (remember to lock!). Or you could have the children read from a pipe.
Another idea is to have each child read one CD. If the CD has been read, the child terminates. Parent notices the child terminates (wait/waitpid) and forks a new one. New child should be passed both a drive and a CD number.
|
|---|