Elizabeth Mattijsen wrote:

I guess I could implement this in my test script using a simple semaphore (shared variable), making sure that all callbacks pull down that semaphore just before they are done and having the main thread block till that semaphore gets to 0. e.g. your Running implementation could drop the other dependencies list and just override threads::create to wrap it in a semaphore up and down calls around the callback.


Indeed. Don't forget that you need to steal threads::new as well ;-)

isn't one the alias of the other?


The bottom line is that I don't want to see that error/warning message in my programs. Ideas?

Convince p5p that there should be a blocking call until all threads have finished. I tried to convince p5p about this and associated functionality about 18 months ago (if I remember correctly). I wasn't successful.

Because perl-ithreads has lost its owner when Arthur has moved to ride the ponie and no-one has stepped up to replace him. Until this happens there is no point to talk to p5p about threads, besides core dumps, because nobody is going to work on it.


Well, and that's exactly the conundrum: any work done on threads may well only appear in blead (and not in 5.8.4). How many people use blead on production systems?

I remember sky saying that threads.xs will be released on CPAN. oh was I dreaming


May be you should try to port your modules into XS. It isn't very complex and you can always ask p5p gurus if you have any questions. so you could start with implementing that blocking call.
BTW, IMHO, that should be called by default by the parent thread, users should need to call threads->running.


No, that was _specifically_ vetoed by Jarkko 18 months ago. When _any_ thread exits, it will take all other threads with it. Including if it is the main thread exiting. The thing is that one of the threads may never exit for whatever reason, and then you're stuck.

"If you want to block until all threads have finished, you will have to do it yourself" was Jarkko's decision.

OK, I didn't remember that. In which case threads should have running() or similar, but not call it by itself.


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to