I have several multithreaded services written in Perl (originaly 5.6.1, now 5.8). I usualy use Win32::BiggerPipe (did not find time to make it CPAN ready) to send data to the children and Win32::Semaphore to control the access to the pipe(s). You may see an example (old, probably no longer functioning script to download images from eGroups/YahooGroups groups). It needs IThread::AtFork module (also not on CPAN). You can read up here on what is this module supposed to solve.
I usualy only need to send commands from the main thread to the children, but you might keep the pipes open in the oposite direction as well and send data back. The only thing you have to keep in mind is that pipe reads are blocking under windows (select() doesn't work) so if you do not want the threads to block you have to use the Win32::Semaphores to signal it's safe to read from a pipe. You of course have to be carefull not to read too much or too little.
Jenda
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live.
-- Rick Osborne
Edit by castaway: Closed small tag in signature
In reply to Re: Useful fork with IPC on win32 ?
by Jenda
in thread Useful fork with IPC on win32 ?
by NetWallah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |