Suggestions for a cond_timedwait() equivalent? 
Author Message
 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/ >



Wed, 24 Jan 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. SNMP Module Suggestions

2. Ugly printf - any suggestions?

3. SUGGESTION: Win32::COM

4. Suggestions Required - New Web Robot

5. Suggestions for Solaris perl 5.00x

6. Suggestions needed for module name

7. Gdb module in the works, would like suggestions.

8. Perl newbie suggestion

9. DBI::Eima - call for suggestions

10. Two suggestions about autoloading.

11. Two suggestions about autoloading.

12. Win32 interface suggestions?

 

 
Powered by phpBB® Forum Software