An alternative to keeping the queue in a database would be to keep it in a plain text file, and manage access to the file with standard file locking flock etc.
In general though, I think that if you have a suitable database available and you are familiar with it, then that would be the more scalable and reliable solution.
I don't think you should create a separate table for each parent PID though as that will pollute the database with lots of tables that have the same purpose. If I where you I would share the same table between all workers, and just have a row that records the PID of the parent. Then in each worker the select call can filter on that PID and only get jobs that pertain to it.
In reply to Re: A per-instance shared queue among forked child processes?
by chrestomanci
in thread A per-instance shared queue among forked child processes?
by EvanK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |