At 11:00 PM 8/19/02 +0100, Dave Mitchell wrote: >On Mon, Aug 19, 2002 at 10:16:11PM +0200, Elizabeth Mattijsen wrote: > > Please note that all of these runs all did the _same_ amount of work, > > just with a different number of worker threads. And as the job itself > > is minimal, we're basically measuring overhead here. The benchmark is > > not measuring thread startup or thread shutdown, just what happens > > inside the threads themselves. >But your code is not using cond_wait()/cond_signal() correctly, so you just >have lots of clients actively fighting each other for the lock.
Well, I would be interested in knowing how you _should_ use cond_wait()/cond_signal() then. I don't see how you can get it together so that the clients are _not_ fighting for the lock(). Because that is the basic problem that I see Perl threads now have. >What is the code actually supposed to be doing as regards synchronising >between the client and server threads? Nothing in this case. I was just showing what happens in these types of situations, that it doesn't scale. If you want to see a real application of this, check out Thread::Tie for instance. Liz