I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2010-07-31 08:43:54.483125-07 by patha in response to 12858
Re: block until one thread is joinable?
This is perhaps better code (replacing select_one_to_join and join_some):
sub join_any () { for (;;sleep(0.01)) { my @thrs = threads->list(threads::joinable); return $thrs[0]->join() if (@thrs > 0) } } sub limit_threads ($) { my ($limit) = @_; for (; threads->list() > $limit; ) { handle_result(join_any()); } }
Direct Responses: 12860 | Write a response