From owner-freebsd-threads@FreeBSD.ORG Fri Aug 4 14:06:29 2006 Return-Path: X-Original-To: freebsd-threads@FreeBSD.org Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8194B16A4E0 for ; Fri, 4 Aug 2006 14:06:29 +0000 (UTC) (envelope-from tataz@tataz.chchile.org) Received: from smtp5-g19.free.fr (smtp5-g19.free.fr [212.27.42.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6205943D6A for ; Fri, 4 Aug 2006 14:06:28 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from tatooine.tataz.chchile.org (tataz.chchile.org [82.233.239.98]) by smtp5-g19.free.fr (Postfix) with ESMTP id 5FE7426563 for ; Fri, 4 Aug 2006 16:06:27 +0200 (CEST) Received: from obiwan.tataz.chchile.org (unknown [192.168.1.25]) by tatooine.tataz.chchile.org (Postfix) with ESMTP id C262C9CA77 for ; Fri, 4 Aug 2006 14:06:57 +0000 (UTC) Received: by obiwan.tataz.chchile.org (Postfix, from userid 1000) id B9063405B; Fri, 4 Aug 2006 16:06:57 +0200 (CEST) Date: Fri, 4 Aug 2006 16:06:57 +0200 From: Jeremie Le Hen To: freebsd-threads@FreeBSD.org Message-ID: <20060804140657.GK4498@obiwan.tataz.chchile.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.11 Cc: Subject: system scope vs. process scope X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2006 14:06:29 -0000 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 >