Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Aug 2006 16:06:57 +0200
From:      Jeremie Le Hen <jeremie@le-hen.org>
To:        freebsd-threads@FreeBSD.org
Subject:   system scope vs. process scope
Message-ID:  <20060804140657.GK4498@obiwan.tataz.chchile.org>

next in thread | raw e-mail | index | archive | help
Hi,

occasionally, I saw environnement variables LIBPTHREAD_SYSTEM_SCOPE and
LIBPTHREAD_PROCESS_SCOPE mentionned hither and thither.  I grep(1)'ed
through the source tree for some documentation, but I wasn't able to
find any.  Read the source Luke...

It seems that the PTHREAD_SCOPE_SYSTEM thread attribute is the default.
Intuitivelely, I would say that setting the PTHREAD_SCOPE_PROCESS
attribute creates a new process with its address space being shared with
the other userland threads (a la Linux) whereas the default behaviour is
to create a new kernel thread.

Am I right ?  What are the pros and cons of either methods ?

In libthr, it seems those environnement variables / attributes leads to
set a flag THR_SYSTEM_SCOPE which doesn't seem to be used in the library
nor in the kernel.

OTOH, in libpthread (libkse), it seems to be widely used.  I fumbled
through the code, but I am not sure to understand what these flags really
do.

Thank you.
-- 
Jeremie Le Hen
< jeremie at le-hen dot org >< ttz at chchile dot org >



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