From owner-freebsd-threads@FreeBSD.ORG Sat Mar 10 00:42:46 2007 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9ADFE16A401 for ; Sat, 10 Mar 2007 00:42:46 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outG.internet-mail-service.net (outG.internet-mail-service.net [216.240.47.230]) by mx1.freebsd.org (Postfix) with ESMTP id 8266013C481 for ; Sat, 10 Mar 2007 00:42:46 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.32) with ESMTP; Fri, 09 Mar 2007 16:16:15 -0800 Received: from [192.168.2.5] (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 6A589125B11; Fri, 9 Mar 2007 16:42:43 -0800 (PST) Message-ID: <45F1FF03.80903@elischer.org> Date: Fri, 09 Mar 2007 16:42:43 -0800 From: Julian Elischer User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221) MIME-Version: 1.0 To: Martin Blapp References: <200703091515.27133.tijl@ulyssis.org> <200703092100.12199.tijl@ulyssis.org> <45F1DD68.8040103@elischer.org> <20070310012921.I6787@godot.imp.ch> In-Reply-To: <20070310012921.I6787@godot.imp.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Daniel Eischen , gerald@freebsd.org, freebsd-threads@freebsd.org Subject: Re: signalling remote threads 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: Sat, 10 Mar 2007 00:42:46 -0000 Martin Blapp wrote: > > Hi, > >> There is no portable way to identify threads in another process. There >> is also no guarantee that the tread is even externally visible. Take > > But is it true for FreeBSD that 'ps -Hauxwww' should show all threads > for a process with libc_r, libpthreads.so, or libthr.so ? no libc_r will only have one line in ps even if there are 10,000 threads because they are an internal 'figment of the imagination of the process". There is NO externally visible sign of them esxcept for the behaviour of the process. (it does a lot of async operations). Similarly for libpthread, it will show SOME threads but not as many as there are threads in the process because only threads that are blocked for IO in the kernel or are actually running at that instant will show up. Threads that are not running or blocked in the kernel are, once again just figments of the imagination of the process. If you run a libpthread process with LIBPTHREAD_SCOPE_SYSTEM set to 'yes'. then it will switch to 1:1 mode and there will be a kernel thread instantiated for each thread in the process and yes you will see them in ps -H. libthr will always show all the threads because it is basically the equivalent and optimised version of libpthread with LIBPTHREAD_SCOPE_SYSTEM set. It only runs in that mode. > > -- > Martin