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

Re: Thread-Tie-0.01

From:
Nick Ing-Simmons
Date:
August 12, 2002 09:07
Subject:
Re: Thread-Tie-0.01
Message ID:
20020812160709.1396.10@bactrian.elixent.com
Elizabeth Mattijsen <liz@dijkmat.nl> writes:
>At 02:59 PM 8/12/02 +0200, Arthur Bergman wrote:
>>>You mean an OS that yields()?  The thing is that using shared variables 
>>>_doesn't_ eat away at CPU as my approach does.  Maybe that is caused by 
>>>the client/server swap you (or Arthur?) were describing...
>>If yield() doesn't yield one might try sleep 0;
>
>Hmmmm... is that something you want me to try out?  Or do you want to have 
>this be part of the documentation?
>
>
>My first question would be: why would I need to do a sleep 0?  Why can't 
>threads->yield do that for me if that is the correct way to yield on this 
>system?

Once shown to work it can. The snag is that (presumably) Linux/glibc 
gets detected as having a pthread_yield() or whatever, and Configure 
test is not robust enough to find it does not work. If "you" can 
establish that sleep(0) _works_ we can add that to some linux hints 
file so that threads->yield starts using it.

>
>
>I will try this and report the result...
>
>
>Liz
-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/




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