Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jan 1999 09:29:09 +1100 (EST)
From:      John Birrell  <jb@cimlogic.com.au>
To:        db@abyssinian.sleepycat.com (Sleepycat Software)
Cc:        jb@cimlogic.com.au, freebsd-hackers@FreeBSD.ORG, openldap-devel@openldap.org, yusufg@huge.net
Subject:   Re: Strange warnings when compiling Berkeley DB on FreeBSD 3.0
Message-ID:  <199901082229.JAA00644@cimlogic.com.au>
In-Reply-To: <199901082218.RAA29040@abyssinian.sleepycat.com> from Sleepycat Software at "Jan 8, 1999  5:18:19 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Sleepycat Software wrote:
> We were told that, for thread-safe programs under FreeBSD,
> we should add -D_THREAD_SAFE to the C pre-processor flags,
> and load against -lc_r.  Is that not correct?

Linking against both libc and libc_r will cause strange results.
Using gcc -pthread is the correct way.

> Is there a
> preferred method of guaranteeing thread safety within the
> Berkeley DB library?

Other than compiling with -D_THREAD_SAFE on FreeBSD, normal thread
safety rules apply. Don't use global variables. Make all functions
re-entrant.

-- 
John Birrell - jb@cimlogic.com.au; jb@freebsd.org http://www.cimlogic.com.au/
CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



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