I would like to create a daemon python process in windows which will spawn 8 processes out. Whenever, there is a job, it will be pushed to the queue and the job will be run. If the full 8 processes are been utilised, then the jobs will remain in the queue for their turn.

My question is

1) How do I create such a daemon program in python such that it will be clean and good, and wun hog down any resources unncessary

2) My idea of pushing the job into the queue is for the daemon program to keep polling a file. If there's a new job, it will be written in the file. Once the daemon program read the file and finds a new entry, it will be push to the queue for it to be executed. Somehow, I feel that this method is not very good as keep polling means that I will keep hogging resources. Would you all have any ideas which will be bettter?


7 Years
Discussion Span
Last Post by pyTony

I am not so sure about interprocess communication alternatives, but I do not think OSes take much penalty for repeatedly checking when one file was last written to.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.