From owner-freebsd-hackers Tue Aug 4 19:25:26 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA17141 for freebsd-hackers-outgoing; Tue, 4 Aug 1998 19:25:26 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp01.primenet.com (smtp01.primenet.com [206.165.6.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA17118 for ; Tue, 4 Aug 1998 19:25:18 -0700 (PDT) (envelope-from tlambert@usr02.primenet.com) Received: (from daemon@localhost) by smtp01.primenet.com (8.8.8/8.8.8) id TAA28283; Tue, 4 Aug 1998 19:25:02 -0700 (MST) Received: from usr02.primenet.com(206.165.6.202) via SMTP by smtp01.primenet.com, id smtpd028253; Tue Aug 4 19:24:58 1998 Received: (from tlambert@localhost) by usr02.primenet.com (8.8.5/8.8.5) id TAA02476; Tue, 4 Aug 1998 19:24:53 -0700 (MST) From: Terry Lambert Message-Id: <199808050224.TAA02476@usr02.primenet.com> Subject: Re: Threaded X libs.. To: doconnor@gsoft.com.au (Daniel O'Connor) Date: Wed, 5 Aug 1998 02:24:53 +0000 (GMT) Cc: tlambert@primenet.com, dag-erli@ifi.uio.no, kaleb@ics.com, hackers@FreeBSD.ORG In-Reply-To: <199808050026.JAA11671@cain.gsoft.com.au> from "Daniel O'Connor" at Aug 5, 98 09:56:22 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > And working Draft 4 compliant threads since 2.2.6-stable. 8-). > > Although PTHREAD_MUTEX_INITIALIZER is now supported, I'm pretty > > sure 2.2.7 and 3.0-current aren't Draft 10/standard compliant yet. > > Hmm.. where could I find information on Draft xx standard? It would > be nice to have a yardstick to measure the implementation by :) Join a POSIX committee. 8-). The information is available in the O'Reilly Pthreads book, which has a section on the differences between the standard and Draft 4. The lack of PTHREAD_MUTEX_INITIALIZER generally indicates a Draft 4 implementation (the most widely implemented Draft, other than Draft 10, which is what was standardized). The bad thing about this is that if FreeBSD is not full standard, then things are not very nice; much code has been written using: #ifndef PTHREAD_MUTEX_INITIALIZER /* use Draft 4 semantics and calling conventsion*/ #else /* use Standard semantics and calling conventsion*/ #endif If FreeBSD is not full Standard, than this code will now break; the PTHREAD_MUTEX_INITIALIZER (and the attr argument to pthread_create) should have been the last things changes when Standard compliance became reality). 8-(. > I got the patched MIT threads library which has more of the standard > implemented.. Now to rebuild XFree86 against it (urgh..) Bad plan. The default FreeBSD libc is not threads safe for user space threads. This means that the code will appear to work, but won't really work. The FreeBSD libc_r overrides system call definitions, as well, instead of merely adding pthreads functions. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message