I have a small app that requires some tasks to run in the background. It’s main purpose is to open a socket to another machine, to send a file over the socket (there can be N machines present) and to listen to the response on another socket. This task might take from 30 seconds to maybe a few hours and the machine is busy for this time and can’t handle any new jobs. Ideally i want to process as many tasks as possible (== non busy machines available) in parallel.
The basic application flow would be:
loop do
# get available machines
# fork a thread / background worker for each
# process a wating job job
end
Can anyone recommend something simple for the described requirements that runs on windows?
Thanks!
Ben
As long as you are fine with “green” (non-native) threads, how about this: