At 00:59 -0800 1/21/04, Stas Bekman wrote:
Elizabeth Mattijsen wrote:
So I think we need to have a new blocking call that will prevent the main program/thread from exiting till all child threads are done.
Thread::Running solves this basically.
   1 while threads->running;
I looked at the implementation. You are such a cheater, Liz ;) But hey, it works. Very cool.

*blush* ;-)



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 ;-)



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?




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.


Liz


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



Reply via email to