Kernel Edgeplay
Chris Babcock <[email protected]>
| Newsgroups | gmane.mail.spam.crm114 |
|---|---|
| Organization | Kolonel Panic |
| Message-ID | <[email protected]> |
I'm building a little something something that spawns multiple asynchronous processes, each of which maintains an independent dialog with an external process. The main thread is a looping daemon that checks a status pipe for messages from daemons it has spawned, pushes data out to any waiting demons and spawns a new daemon child if there aren't any waiting for data. Each of the daemon children grabs data off an input pipe, does a merge with a template supplied at creation, runs an SMTP conversation via a telnet process to the local mail server and lets the parent know when its ready for another record. Even with pipelining to a local mail server the telnet process has to be watched: #!/bin/sh # cto.sh - Configurable Time Out # $1 - PID to timeout # $2 - Seconds to timeout sleep $2s kill $1 The child starts the telnet process and calls cto.sh asynchronously with the PID whenever it polls the telnet process for a response. When telnet returns data, the child kills the current cto.sh process. The obvious problem here is that every child spawned off the main loop is using 6 or 9 processes at any time. When you add in the processes from the mail server that's 400-500 concurrent processes from this application... assuming that I configure the MTA to enforce the same limits on local connections that it applies to outside servers. I have a little while to work on this, because the first version is just going to dump the merged documents to the sendmail command, but I do want to know if there's a better idiom for watching a process that I'm missing coming at the problem like a shell script. Also, if there's room to tweak syscall to do this housekeeping since you're already wrapping the external process when you do an asynchronous call that would be Godiva. Chris ------------------------------------------------------------------------------ _______________________________________________ Crm114-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/crm114-general
signature.asc
(application/pgp-signature, 489 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iQEcBAEBAgAGBQJJW/kuAAoJELzb9AybTudVxFgH/2vYWbbsCV2A6ZPabG7p8Bgr KQYXyFXGmMpfpn9cUX7j9iKu55vmdaFTwgJA3snUa9ssJzORxZojNfeOQm7wkVgp zFyyi0Esmw4tB2C+2XqMKb1UEY1zwAg0EzLJoQBVIvWLrJXbgHzj6vl2DERaBoaj 0j3t1iBh2hcpnZ75wS1IfQNe2doHuRe3/uLK1pcdwT0Uheu1I/sFY5yF+IFIoBkk orxeATJ+Rih/lGdNJmxGvJXqBBLunm5C2x6yz7mkQlZVYHBJM/pzRfKdLn2H0gOn 6f26x5UbRT8c3wOOxbswRtkl5HZ34VlqOCO1HDpDqhL7VBRI5RLcupS2+sIkszQ= =EXXo -----END PGP SIGNATURE-----