From owner-freebsd-hackers Wed Nov 26 04:33:09 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id EAA13152 for hackers-outgoing; Wed, 26 Nov 1997 04:33:09 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from heron.doc.ic.ac.uk (+DIcYY4Hwhb2UrSDyD1o6Q0k6YdHuXOs@heron.doc.ic.ac.uk [146.169.2.31]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id EAA13138 for ; Wed, 26 Nov 1997 04:33:02 -0800 (PST) (envelope-from njs3@doc.ic.ac.uk) Received: from ash3.doc.ic.ac.uk [146.169.16.31] ([JAN4awqvQujo8cHw8KeFN6Ct46dKCTva]) by heron.doc.ic.ac.uk with smtp (Exim 1.62 #3) id 0xaggN-000085-00; Wed, 26 Nov 1997 12:35:07 +0000 Received: from njs3 by ash3.doc.ic.ac.uk with local (Exim 1.62 #1) id 0xageF-0005pH-00; Wed, 26 Nov 1997 12:32:55 +0000 From: njs3@doc.ic.ac.uk (Niall Smart) Date: Wed, 26 Nov 1997 12:32:54 +0000 In-Reply-To: Charles Mott "Re: pthread_cond_timedwait returning wrong error?" (Nov 25, 3:24pm) X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: Charles Mott , Niall Smart Subject: Re: pthread_cond_timedwait returning wrong error? Cc: hackers@freebsd.org Message-Id: Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Nov 25, 3:24pm, Charles Mott wrote: } Subject: Re: pthread_cond_timedwait returning wrong error? > On Tue, 25 Nov 1997, Niall Smart wrote: > > On Nov 25, 12:24pm, Charles Mott wrote: > > } Subject: Re: pthread_cond_timedwait returning wrong error? > > > > > > To me, having all the *_r reentrant functions is a big nuisance. > > > > Yeah, lets invent our own standard! Or maybe we should just leave out > > threads altogether and stick with badly designed interfaces! > > > I quess I was referring to the *_r functions on Solaris that I don't see > anywhere else. Are these standard? Yes, to the POSIX pthreads standard. > I think having the standard Unix > function calls with hidden thread addaptations like the errno solution > (mapping errno to a function) explained by Alex Nash seems like a good > idea to me. I think this is a kludge, although it is compliant with the POSIX API and the best option given the circumstances. WindowsNT uses GetLastError() or somesuch, I would prefer to see something like this. (of course, in libc_r errno does expand to a function call, I just don't think its good to have this ``hidden'' expansion) Also, it is not practical to fix all broken interfaces in this way, consider getpwent(), to make the existing interface thread safe it would have to use thread specific data internally. This overcomplicates its implementation, a better way is to make the thread provide the thread specific data (e.g. from a buffer on the stack) If every interface in libc_r that used static data was converted to use thread specific data its complexity, and therefore the number of bugs, would rise substantically > What I have observed from Solaris, FreeBSD, Linux and OSF is that there > doesn't seem to be any standard that is obvious to me. Even OSF 3.2 and > 4.0 are different from each other. This is a major source of annoyance if > one is trying to develop software which will cleanly compile accross > different platforms. This is probably due to the various operating systems implementing different drafts of the POSIX standard, hopefully in the next releases of the OS' incompatabilities will not be an issue. (yeah right!) :) Regards, Niall