Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Dec 2015 16:15:10 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Daniel Eischen <deischen@freebsd.org>
Cc:        John Baldwin <jhb@freebsd.org>, freebsd-arch@freebsd.org, freebsd-threads@freebsd.org
Subject:   Re: libthr shared locks
Message-ID:  <20151230141510.GC3625@kib.kiev.ua>
In-Reply-To: <Pine.GSO.4.64.1512291402580.2643@sea.ntplx.net>
References:  <20151224191408.GA3625@kib.kiev.ua> <Pine.GSO.4.64.1512251310090.14902@sea.ntplx.net> <20151226105409.GH3625@kib.kiev.ua> <Pine.GSO.4.64.1512261151550.19056@sea.ntplx.net> <20151226234424.GJ3625@kib.kiev.ua> <Pine.GSO.4.64.1512271110450.23305@sea.ntplx.net> <20151228105157.GQ3625@kib.kiev.ua> <Pine.GSO.4.64.1512281118480.27627@sea.ntplx.net> <20151229184405.GY3625@kib.kiev.ua> <Pine.GSO.4.64.1512291402580.2643@sea.ntplx.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Dec 29, 2015 at 02:18:27PM -0500, Daniel Eischen wrote:
> Perhaps another option is doing all of what we said above
> and also use your suggestion of libthr2, but have both libthr
> and libthr2, where libthr2 is labeled experimental or something
> similar.  Have a WITH_LIBTHR2 build flag that conditionally
> inlines the pthread locks and enables (links w/-pthread) libthr2
> for FreeBSD base OS.  A note/comment for the WITH_LIBTHR2 flag
> states that all ports must also be recompiled to be on the
> safe side.  This allows one to switch back and forth, as long
> as any affected ports are also rebuilt.
> 
> If we were to introduce this in a future 12-current, we might
> have the WITH_LIBTHR_FOO flag anyway, at least initially, so
> perhaps it wouldn't be extra work.


This is cheating, but I agree that this is quite plausible approach. I
think about also adding the __INLINE_PTHREAD_LOCKS preprocessor macro to
select inlined locks at the compilation time. In other words, the user
which wants to start experimenting with the stuff would do

	cc -D__INLINE_PTHREAD_LOCKS -c ....
	cc -o program ... -lpthread2

I may just do this after I finish with my patches.



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