Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Dec 1997 17:53:34 -0600 (CST)
From:      "Daniel M. Eischen" <deischen@iworks.interworks.org>
To:        Arjan.deVet@adv.IAEhv.nl, freebsd-hackers@freebsd.org
Subject:   Re: pthreads
Message-ID:  <199712012353.RAA04567@iworks.InterWorks.org>

next in thread | raw e-mail | index | archive | help

> >Anyone else out there have applications using pthreads other than Python?
>
> Squid 1.2beta has the possibility to use pthreads but when I tried it a
> month ago I couldn't get it to run on FreeBSD (haven't tried it yet after
> the recent changes to libc_r). I also tried it on BSD/OS recently and it
> more or less works on BSD/OS 3.1 (not 3.0).

I have some experience in getting an application working with pthreads.
I ported the GNAT (Ada95) compiler to FreeBSD which uses pthreads for
tasking.  Until recently (last week), FreeBSD pthreads returned non-standard
error codes.  The POSIX spec specifies that the error codes should (shall)
be returned to the caller as the return value from the pthread function call.
FreeBSD was returning -1, and setting the thread-safe errno to the error
code.

For instance, a timedout call to pthread_cond_timedwait() would return -1
and set errno to EAGAIN, instead of returning ETIMEDOUT and leaving errno
untouched.  GNAT uses pthread_cond_timedwait as its mechanism for performing
tasking delays and other timed operations.  Until I accounted for this
non-standard operation, GNAT tasking would not work properly.

If you've got access to a -current box, try squid or python on there
with the changes to pthreads.  Or, you can search for all pthread
calls and see if they are relying on error codes being returned from
the calls.  It is easy enough to search the pthread source in
lib/libc_r/uthread/... to see exactly what FreeBSD is returning.

Note if you are able to make Squid or Python work with our pthreads,
it'd be nice to make it work for both the standard and non-standard
versions :-)

Dan Eischen
deischen@iworks.InterWorks.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712012353.RAA04567>