in reply to running multiple sub routines at the same time

Everyting I read about fork or exec tell me it makes the other process wait.

fork and exec are very different things. They are frequently used in conjunction, but grouping them together as you have only confuses the issue.

If you are talking about fork, then no, it does not "make the other process wait." In fact, it is designed specifically to allow you to do two things at the same time. You can probably accomplish your task with a forked process watching the db size, though it might not be the easiest solution.

If you meant exec, well, then perhaps your statement applies. Though it's worth pointing out that exec doesn't "make the other process wait" so much as "take over completely." That is, when you exec something, that thing takes over the process and you never get control back.

Notwithstanding the fact that fork can probably do what you want, the simplest solution is probably something along the lines of that suggested by dragonchild.

  • Comment on Re: running multiple sub routines at the same time