Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Dec 1998 07:10:40 -0600
From:      Richard Seaman <dick@ns.tar.com>
To:        Jeremy Lea <reg@shale.csir.co.za>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: Threads in WINE [was: linking against libc_r]
Message-ID:  <19981223071040.A77487@ns.tar.com>
In-Reply-To: <19981222174945.A69445@tar.com>; from Richard Seaman on Tue, Dec 22, 1998 at 05:49:45PM -0600
References:  <Pine.BSF.4.05.9812210104430.479-100000@smarter.than.nu> <Pine.BSF.4.05.9812211024340.6331-100000@bright.fx.genx.net> <19981221093241.C546@tar.com> <19981221192734.E4060@shale.csir.co.za> <19981221114939.A5500@tar.com> <19981223001304.A319@shale.csir.co.za> <19981222174945.A69445@tar.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Dec 22, 1998 at 05:49:45PM -0600, Richard Seaman wrote:
> 
> The FreeBSD libc can be partly re-entrant now.  In order to make the portions
> of libc that are designed to be re-entrannt actually behave in that manner,
> you need to satisfy the following three conditions:
> 
> 1) You must set the libc variable (which is visible externally)
> __isthreaded to a non zero value.
> 
> 2) You must provide an implementation of the function _spinlock
> which is declared in src/lib/libc/include/spinlock.h.  The
> implementation probably needs to be "recursive" if you're going
> to get optimum results.
> 
> _spinlock needs to override the weak aliased _spinlock that
> is implemented in libc as a stub function
> 
> 3) You must provide implementations of flockfile, ftrylockfile,
> and funlockfile.  Maybe also _flockfile_debug if you're going
> to use the debug version.
> 
> These need to override the weak aliases for these functions
> in libc, which are also just stub functions.
> 
> If you link with the libpthreads that is generated by the
> liblinuxthreads "port" noted above, you should get the
> three conditions met.

My brain was only partly in gear when I wrote this.  There is an important
fourth condition imposed by the specific implementations of _spinlock,
flockfile, ftrylockfile and funlockfile included with liblinuxthreads.
They all use pthread_self, or its relative, thread_self.  You must create
your threads using pthread_create for pthread_self to work.

-- 
Richard Seamman, Jr.          email: dick@tar.com
5182 N. Maple Lane            phone: 414-367-5450
Chenequa WI 53058             fax:   414-367-5852

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



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