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

Re: Goodbye to threads

Thread Previous | Thread Next
From:
Elizabeth Mattijsen
Date:
August 20, 2002 00:50
Subject:
Re: Goodbye to threads
Message ID:
4.2.0.58.20020820092828.06ad5e40@mickey.dijkmat.nl
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


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About