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.


In reply to Re: running multiple sub routines at the same time by revdiablo
in thread running multiple sub routines at the same time by mnlight

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.