in reply to Re^2: Parallel tasks
in thread Parallel tasks

fork() on win32 is an emulation. It is known not to play well with Win32::OLE which tickles the bugs. There issue is the children segfaulting on exit.

You may be able to get something working with threads, then again you may not. I suggest the easiest way would be to use Win32::Process to fire up your 10 processes. They will all have there own perl interpretter so there should be no issues porvided you have enough memory. All you have to do is create you initial pool and loop over them waiting for one to exit so you can spawn the next one.

cheers

tachyon

Replies are listed 'Best First'.
Re^4: Parallel tasks
by john.goor (Acolyte) on Jul 13, 2004 at 08:39 UTC
    Thanks for your quick reply tachyon,
    The problem however is not how to fire up processes, but how to fire up a process for each collection, and the collection information is stored in a MSSQL database, so there is no way I can drop the Win32::OLE-thing.
    Ofcourse I can try to code around this, which means I have to find another way to access the database, possibly causing other problems. Apparantly there is a downside to eveything, and I have to cope with that. The bad thing is I was counting on this to work since we have a serious problem here and by the end of this day our product goes live! Now I solved things with Win32::Process, each of the processes starting in it's own shell.
    When the parent dies however the childers keep on going. Also The children are out of control, so our M$ machine died this weekend because 100's of 'CMD.EXE''s were romping around.
    That's okay for monks, but not for lost processes. ;-) If you or anyone else 'sees the light', be welcome to help this lost monk.
    In the meantime I'll start humming.
    Hmmmmmmmmmmmmmmmmmmmmmmmmmm............. }-|
    Rgds, John

      and the collection information is stored in a MSSQL database, so there is no way I can drop the Win32::OLE-thing.

      Well actually if the only reason you are using Win32::OLE is to access MSSQL you can drop the Win32::OLE thing. Why not just use DBD::ODBC and DBI? Win32::OLE is *slow* so you should see it work substatntially faster as a bonus.

      cheers

      tachyon