CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
Weird behavior using Proc::Background

 



buterrier2001
New User

May 23, 2007, 8:30 AM

Post #1 of 5 (4703 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


KevinR
Veteran


May 23, 2007, 11:09 AM

Post #2 of 5 (4701 views)
Re: [buterrier2001] Weird behavior using Proc::Background [In reply to] Can't Post

Do you have the Win32::Process modules installed also?

Is $job_id a number?
-------------------------------------------------


buterrier2001
New User

May 23, 2007, 11:13 AM

Post #3 of 5 (4700 views)
Re: [KevinR] Weird behavior using Proc::Background [In reply to] Can't Post

$job_id is an integer, so storing it in an array should work.

I didn't explicitly install the Win32::Process modules. They aren't part of the Proc::Background as default? If not, you may have solved my problem.

~Steve


KevinR
Veteran


May 23, 2007, 1:16 PM

Post #4 of 5 (4699 views)
Re: [buterrier2001] Weird behavior using Proc::Background [In reply to] Can't Post


In Reply To
They aren't part of the Proc::Background as default?


I don't know. You will have to check into that.
-------------------------------------------------


KevinR
Veteran


May 23, 2007, 1:21 PM

Post #5 of 5 (4697 views)
Re: [buterrier2001] Weird behavior using Proc::Background [In reply to] Can't Post

After a little reading, it seems Win32::Process is a core module if you are using activestate perl so it should be installed if that is the case.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives