
buterrier2001
New User
May 23, 2007, 8:30 AM
Post #1 of 5
(3522 views)
|
|
Weird behavior using Proc::Background
|
Can't Post
|
|
I just tried to implement the Proc::Background module into the major Pipeline script that is used at our company. This would be very helpful, as our current pipeline takes in a job ID from our database, and then process the data from that particular job (runtime of the processing is ~1 hour). The pipeline is always running (it’s on a timer to check the database every 30 seconds for a new job). Due to the nature of the programming, we had to process jobs serially. To try and parallelize the pipeline, I implemented the Proc::Background module, and I’ve cut our old pipeline into two parts: the timer and the actual data processing. The timer uses the Background module to spawn off the data processing program in the background. Because the timer is continuously running, I create an array called @proc (so I don’t use the same $proc variable twice), and the index of the array is the $job_id that is obtained from the database, and the pipeline executable takes the job id as an argument so it knows what to, so it looks like it should work: foreach my $job_id (@job_ids) { my $command = "G:\\ProgramFiles\\Pipeline_Scripts\\pipeline_new.exe $job_id"; $proc[$job_id] = Proc::Background->new($command); $proc[$job_id]->alive; } Anyhow, the behavior that I see is such that when a process is running and then there are new processes to be spawned, the new processes don’t actually start. Do you know why this is happening? I’m working on a Windows XP machine. Thank you in advance for any help you can offer me! ~Steve
|