Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Apr 2006 15:49:18 -0400
From:      Miles Nordin <carton@Ivy.NET>
To:        freebsd-sparc64@freebsd.org
Subject:   Re: pthread_mutex_timedlock on sparc64
Message-ID:  <oqk69khvsx.fsf@castrovalva.Ivy.NET>
In-Reply-To: <20060420182331.GA26174@xor.obsecurity.org> (Kris Kennaway's message of "Thu, 20 Apr 2006 14:23:31 -0400")
References:  <20060418204240.GA69833@xor.obsecurity.org> <001801c66372$a032e770$2522630a@t22> <20060419054116.GA39394@xor.obsecurity.org> <Pine.GSO.4.64.0604190835400.1870@sea.ntplx.net> <20060420074713.Y52948@hades.admin.frm2> <20060420182331.GA26174@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--pgp-sign-Multipart_Thu_Apr_20_15:49:18_2006-1
Content-Type: text/plain; charset=US-ASCII

>>>>> "kk" == Kris Kennaway <kris@obsecurity.org> writes:

    kk> Then we can make libthr the default on FreeBSD 6.x as well.

1. is libpthread a real library or a placeholder that you point at
   your choice of thread implementation?

2. How many native thread implementations are there (in the base
   system), working or not on all FreeBSD versions?  Two?  Or three?
   or...

3. What libraries do you link for each?

On NetBSD, I type -lpthread and get Scheduler Activations.  no
choosing.  Either it works or it doesn't.

On Solaris, if I type 'man pthreads' or 'man threads' it'll tell me
they have two thread implementations, and it'll tell meq how to choose
which one I want.  I think in Solaris 8 they had four.  I don't have
Solaris 8 so I could be wrong about how to choose them, but as an
example for what I want to know about FreeBSD:

-mt                          Solaris threads  \
-mt -lpthread                POSIX threads    / MxN threads
-mt -L/usr/lwp/lib           Solaris threads  \
-mt -L/usr/lwp/lib -lpthread POSIX threads    / 1:1 threads

so, if I want POSIX threads I add the -lpthread wrapper.  It's not a
placeholder---it's a wrapper around libthread which is always there,
different from FreeBSD?  If I want 1:1 threads rather than MxN
threads, I searach the libraries from /usr/lwp/lib first.  Definitely
different from FreeBSD which uses libmap.conf instead of -L?

I'm hearing that FreeBSD has 1:N threads, MxN threads, and 1:N
threads.  And that they're all POSIX (-lpthread style) threads.  ok,
understood.

But in kse(2) you guys call 1:N threads ``N to 1'' threads.  And you
call 1:1 threads ``N to N'' threads.  confusing.  But I don't know how
to choose which I want of 1:N, 1:1, or MxN.  I also don't know which
are available/working on which architectures and releases---that of
course changes, but maybe there's a place to explain at least how to
choose and what you're choosing, which shouldn't change as things are
fixed and retired?

--pgp-sign-Multipart_Thu_Apr_20_15:49:18_2006-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (NetBSD)

iQCVAwUAREflvonCBbTaW/4dAQIYUQP+IzH5sZsZJCnLYSY7AEirKaMeDva8ZHrr
yeRzW7Q9t8A0CEnoPesddf0cUETwVqspf4PrgsszvQU6ZnjMRZnSH5miCG1SL54i
yMmv3v7AUIzayCyuw5e1QJpJ3nE4ia1RmKr8eiWcovlxFHK735/wMLGtdjw0VL6O
lg4wCQQ5fsI=
=Gcn+
-----END PGP SIGNATURE-----

--pgp-sign-Multipart_Thu_Apr_20_15:49:18_2006-1--



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