|Perl: the Markov chain saw|
creative forking (code)by deprecated (Priest)
|on Nov 04, 2001 at 02:39 UTC ( #123102=perlquestion: print w/replies, xml )||Need Help??|
deprecated has asked for the wisdom of the Perl Monks concerning the following question:
I've got a rather large (~1000 lines) program that runs continually. However, it is "event driven" and doesnt actually do anything until it getts a specific kind of input, or I prod it in some fashion. I have lately been wanting to include a sort of "memo" or "reminder" function into it.
I figure it would require forking off a sub that wasnt event driven. In other words, a specific event would drive a fork in the middle of a sub that was _not_ event driven, like so:
the problem is, since fork() creates a _copy_ of the program youre running, and your current program is 50mb in memory, you could *seriously* hurt the host machine if you had, say, twenty of them running... as I might well do with a reminder sub.
Back to Seekers of Perl Wisdom