
Suggestions for a cond_timedwait() equivalent?
Hi,
I'm writing an online interactive game (a MUD) in perl, and have recently
been experimenting with threads in 5.005.
I'm attempting to create a threaded event queue object that accepts events
to be executed, and assigns one of a pool of threads to execute each one.
This, so far, has worked beautifully, but I would like the event queue to
be able to add to or reduce the number of threads in the pool when the
load changes, but am at a loss to figure out how to have threads in a
cond_wait() wake up after a specified interval so they may be told to
expire.
I don't think alarms will work, as SIGALRM is caught by the Thread::Signal
thread, and so can't be used in the same way as in a serial app, right? I
know that there's a cond_timedwait() function in pthreads -- is there any
equivalent planned for perl threads, and/or a workaround that will supply
equivalent functionality in the meantime?
I've been a lurker on p5p for a while, and have searched the archives for
both it and the various clpm.* newsgroups, but I can find no mention of a
similar problem. Am I missing something?
--
Perlmage and Believer
The FaerieMUD Consortium < http://www.*-*-*.com/ >