Shane McCarron wrote: > This would definitely work - we do it now to emulate "background" > execution. However, we have a related problem that hopefully someone > has solved. Consider this model: > > CLIENT <--> PARENT <--> CHILD > <--> CHILD2 > <--> CHILD3 > > > The PARENT process is a daemon written in perl that is listening for > incoming requests to perform various tasks. As those requests come in, > PARENT needs to start up CHILD scripts (or executables - doesn't really > matter) and then communicate with those CHILD processes via STDIN and > STDOUT (think something interactive like "bc"). When the CHILD > completes, we clean it up and wait for more requests. While it is > running, the CLIENT might be polling the PARENT for status, or sending > instructions to start new CHILDren or whatever. > > On UNIX/Linux, we achieve this using select and it works very well. On > Windows, apparently select does not work on "files", only on sockets. > We are tearing our hair out trying to resolve this, but so far no joy. > Does anyone have any suggestions?
1) Use sockets with the children (a fair amount of coding). 2) Use files and poll the files for size changes (sloppy and not event driven). 3) Use shared memory (not a good choice since the only version is unsupported). 4) Do it all in the parent and forget the children (a matter of including the child code into the daemon and where you would normally send a cmd to the pipe, just call the child sub (make sure the child doesn't lock up the task). I would probably be tempted to use 4), but 1) should also be feasible. In any case, I wouldn't use fork if children are involved (use Win32::Process). -- ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff) _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
