Subject: Possible issue with pthread conditions
To: NetBSD Help <netbsd-help@NetBSD.org>
From: Arash Partow <arash@partow.net>
List: netbsd-help
Date: 08/23/2004 17:31:45
Hello all,

I'm having some issues with pthreads and pthread conditions, I've
written a simple test case scenario, when I run it within a few
seconds of the application running the following message appears:

POSIXThreadConditionTest: Error detected by libpthread: Invalid wait time.
Detected by file "usr/local/src/lib/libpthread/pthread_cond.c", line 187, function "pthread_cond_timedwait".
See pthread(3) for information.

The test case makes a number of threads, each thread has a local
condition variable from which it invokes the pthread_cond_timedwait
function. The thread will invoke the function with 40 different time-out
values, ranging from 1ms to 167ms. Once the thread has finished its task
it goes into a dead state where-by it is cleaned-up and a new thread is
instantiated to take its place. The test just repeats itself over and
over until the user fires a SIG-INT.

I'm not sure if the problems I'm seeing is related to what I'm doing (my code)
or whether its a NetBSD related issue.

I was hoping a few kind people could have a go at running this code
and tell me if they too see this error, I would like to be certain its
a bug related to the OS before I write a problem report. I've uploaded
the test and it can be downloaded from the following url:

http://www.partow.net/netbsd/netbsd-problem-23-08-2004.tgz


to make and run the test do the following:

./make all
./POSIXThreadConditionTest

I used GCC 3.4 to compile the code.

The system used is kernel 2.0, pentium 1.2ghz, 512mb ram. I've run this same
test on linux with kernal 2.6 and cygwin with cygwin1.dll version 1.5+
using similar hardware specs and in both cases I have not come across
any errors.



Any help would be very much appreciated.


Kind regards



Arash Partow

__________________________________________________
Be one who knows what they don't know,
Instead of being one who knows not what they don't know,
Thinking they know everything about all things.
http://www.partow.net