At 05:34 PM 7/23/02 +0100, Ray Hilton wrote:
>Hmmm, ok, seems I was in error, the reason is still not clear as to why
>it doesn't work properly, but it seems that the threads are taking so
>long to spawn that it seems like the process is serial.

It can take a lot of wallclock time.  Are you sure your machine is not 
starting to swap?


>... It seems to
>take about a second for threads->new() to return, very odd, but it
>doesn't always happen as a small script I wrote to prove myself wrong
>ran fine (as long as I joined everything by the end of the block).

Joining threads that have had their purpose is a Good Thing To Do (tm).
Anything returned by the thread is kept in memory until it can be returned 
to the join().  The memory of the thread is kept "alive" as well as long as 
no values are returned.

Of course, you can detach() threads.  But then you complete lose control 
over them, and cannot know whether they're still there or not.


>Any ideas?  It seems whatever way I try and implement this, it is just
>not going to work.

I've felt quite the same when I was implementing Thread::Pool.  Maybe you 
can post some of your code, or send it off-list to me, so that we/I can see 
if there are any alternatives...



Liz

Reply via email to