Subject: Re: pthread, pth select
To: Nick Hudson <skrll@netbsd.org>
From: Jorgen Lundman <lundman@lundman.net>
List: netbsd-users
Date: 10/03/2003 16:56:59
Right, installed pth-2.0.0. I did notice some changes wrt select().

However, adding some printf, I get:

Starting thread 1
Thread 1 running
<main thread hung, no thread 2>

Adding:

         pthread_yield_np();
         select (0, NULL, NULL, NULL, &delay);

to thread 1's loop, I get:

Starting thread 1
Thread 1 running
Starting thread 2
Thread 2 running
<main thread hung, only thread 2 executing>

Also changing thread 2's loop to call yield and all three thread run as 
expected. Except at a very jerkily pace. (Since it sleeps for all threads). I 
did see they mentioned a pth_nanosleep, maybe I can patch it to call that.

But select() definitely does not release cpu.


Lund


Nick Hudson wrote:
> On Friday 03 October 2003 8:15 am, Jorgen Lundman wrote:
> 
>>Does that include if it is included as pthread.h and linked against
>>-lpthread  (but come from pth's pthread compat setup) ?
> 
> 
> Yes.
> 
> 
>>Version in header is: "1.4.1 (27-Jan-2002)"
>>Pkginfo say: pth-1.4.1
> 
> 
> This looks rather old.  I'd suggest 1.4.1nb6 or newer.
> 
> Nick
> 
> 

-- 
Jorgen Lundman       | <lundman@lundman.net>
Unix Administrator   | +81 (0)3 -5456-2687 ext 1017 (work)
Shibuya-ku, Tokyo    | +81 (0)90-5578-8500          (cell)
Japan                | +81 (0)3 -3375-1767          (home)