Date: Thu, 1 Nov 2007 12:51:40 -0400 From: "Andy Harrison" <aharrison@gmail.com> To: freebsd-questions@freebsd.org Subject: Re: sh script difficulties (running parallel functions) Message-ID: <a22ff2940711010951h58bca4fbxeb3fed54a25d9f26@mail.gmail.com> In-Reply-To: <b53f6f940711010931i7067aad0y8c0d2c76aeec3248@mail.gmail.com> References: <b53f6f940711010931i7067aad0y8c0d2c76aeec3248@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/1/07, David Naylor wrote: > # !!! Somehow wait for over workers to finish before continuing !!! > } > > #Finished > > Furthermore, how can signals be handled such that the signals get > accumulated and once all the other workers have finished the signals get > passed on (appropriately) One simplistic way of doing something like that is to make each worker process write a file out to disk upon completion. Then have a while loop that sleeps for a minute and then checks for the existence of that file and if it finds it, execute other commands. Probably not the cleanest method, but I think you'll find that handling forks and signals in a shell script is more trouble than it's worth. - -- Andy Harrison public key: 0x67518262 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: http://firegpg.tuxfamily.org iD8DBQFHKgQ1NTm8fWdRgmIRAn7eAKCZthrDzv0j7J6urphY3ohm6bSPZgCeIAt6 vhC2Zxw0ZTxw8eT+NZ/Uktg= =schR -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a22ff2940711010951h58bca4fbxeb3fed54a25d9f26>