develooper Front page | perl.ithreads | Postings from August 2002

Re: Goodbye to threads

Thread Previous | Thread Next
Elizabeth Mattijsen
August 20, 2002 00:50
Re: Goodbye to threads
Message ID:
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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About