At 17:23 -0800 1/20/04, Stas Bekman wrote:
Elizabeth Mattijsen wrote:
One could argue that detached threads shouldn't be counted. But, as I said, a detached thread is also yanked from existence as soon as any other thread does an exit().
Hope this explains it a bit.
Thanks, Liz. But how do we deal with this problem. Should I always finish threads programs with:

$_->join() for threads->list();

but that won't work with detached threads, since list() will return only a list of non-detached threads.

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;

Note that this module uses a method of operation that suffered in tha last Apache module discussion: it creates additional methods in the threads:: namespace ;-)

Mind you, I think this should be done in threads.xs, but I haven't build up the courage to undertake that.


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.



Liz


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



Reply via email to