Subject: Re: select call implementation and threads
To: malleswararao venkatanaga <bobbyavn@yahoo.com>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-userlevel
Date: 05/25/2003 22:08:12
malleswararao venkatanaga wrote:
> I've reversed the above 2 lines. But i still get 
> non-deterministic results, one of the threads gets
> blocked and never comes out of the select call though
> it has messages to read.

Well, after I fix the pthread_join() call to use correct 
parameters (threads[0] instead &threads[0]), and of course
call pthread_create() before stub_test2() call, I get what
seems to be correct behaviour - I get periodic messages

sent message
Recvd some message  main thread

and

read 5 bytesRead bytes thr 2 5
Buff contents = h
Buff contents = e
Buff contents = l
Buff contents = l
Buff contents = o
sent message

I guess one shouldn't ignore compile warnings ...

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-