From owner-freebsd-threads@FreeBSD.ORG Mon Nov 28 02:01:46 2005 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 CA69E16A41F for ; Mon, 28 Nov 2005 02:01:46 +0000 (GMT) (envelope-from nb_root@videotron.ca) Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id D7B7843D5D for ; Mon, 28 Nov 2005 02:01:45 +0000 (GMT) (envelope-from nb_root@videotron.ca) Received: from clk01a ([66.130.198.54]) by VL-MO-MR003.ip.videotron.ca (Sun Java System Messaging Server 6.2-2.05 (built Apr 28 2005)) with ESMTP id <0IQN0058N6YW9620@VL-MO-MR003.ip.videotron.ca> for freebsd-threads@freebsd.org; Sun, 27 Nov 2005 21:01:45 -0500 (EST) Date: Sun, 27 Nov 2005 21:01:32 -0500 From: Nicolas Blais To: freebsd-threads@freebsd.org Message-id: <200511272101.38903.nb_root@videotron.ca> MIME-version: 1.0 Content-type: multipart/signed; boundary=nextPart1494872.MxKkvnvTrC; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-transfer-encoding: 7bit User-Agent: KMail/1.8.3 Subject: 1 process, 2 threads, how many cpus? 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: Mon, 28 Nov 2005 02:01:46 -0000 --nextPart1494872.MxKkvnvTrC Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline As I was looking around the net for some information on pthreading in FreeB= SD,=20 I came across something that got my attention: "The native user threads cannot concurrently run more than one thread on=20 separate processors at one time. If you are running a single process with=20 multiple CPU-intensive threads in hopes of utilizing multiple processors, y= ou=20 must use Linuxthreads to get this performance." (http://www.unobvious.com/bsd/freebsd-threads.html) Is this still applicable now (FreeBSD 5.4/6/CURRENT)?=20 I'm writing a software that runs 1 process and multiple threads (with pthre= ad)=20 that performs calculations and I was wondering if on a SMP system the threa= ds=20 will run on an independant cpu. It would be quite pointless to have all=20 threads of the same process sharing a single cpu. Also, no matter how many threads I create within a process, 'top' only repo= rts=20 2 threads. The following 'top' run reports my software ('aite') as using 2= =20 threads (when it actually created 4): CPU states: 99.2% user, 0.0% nice, 0.8% system, 0.0% interrupt, 0.0% id= le Mem: 257M Active, 1422M Inact, 189M Wired, 85M Cache, 112M Buf, 49M Free Swap: 2000M Total, 2000M Free PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND 89728 nicblais 2 20 0 4420K 2384K ksesig 0:18 77.44% aite Any insight appreciated, Nicolas. =2D-=20 =46reeBSD 7.0-CURRENT #2: Sat Nov 26 10:55:30 EST 2005 =20 nicblais@clk01a:/usr/obj/usr/src/sys/CLK01A=20 PGP? (updated 16 Nov 05) : http://www.clkroot.net/security/nb_root.asc --nextPart1494872.MxKkvnvTrC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQBDimUC4wTBlvcsbJURAlP0AKCUuZJ7/+tqZrCfS9eaJu+jVkAmeQCfYf/r kgOWgxV8yIktXm3YxYwAIas= =z+ia -----END PGP SIGNATURE----- --nextPart1494872.MxKkvnvTrC-- From owner-freebsd-threads@FreeBSD.ORG Mon Nov 28 04:10:53 2005 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 BFEF016A41F for ; Mon, 28 Nov 2005 04:10:53 +0000 (GMT) (envelope-from julian@elischer.org) Received: from delight.idiom.com (outbound.idiom.com [216.240.47.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id F10BD43D55 for ; Mon, 28 Nov 2005 04:10:52 +0000 (GMT) (envelope-from julian@elischer.org) Received: from idiom.com (idiom.com [216.240.32.1]) by delight.idiom.com (Postfix) with ESMTP id A48D7227262; Sun, 27 Nov 2005 20:10:52 -0800 (PST) Received: from [192.168.2.5] (home.elischer.org [216.240.48.38]) by idiom.com (8.12.11/8.12.11) with ESMTP id jAS4AnaT012210; Sun, 27 Nov 2005 20:10:51 -0800 (PST) (envelope-from julian@elischer.org) Message-ID: <438A8349.7020508@elischer.org> Date: Sun, 27 Nov 2005 20:10:49 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.11) Gecko/20050727 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nicolas Blais References: <200511272101.38903.nb_root@videotron.ca> In-Reply-To: <200511272101.38903.nb_root@videotron.ca> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-threads@freebsd.org Subject: Re: 1 process, 2 threads, how many cpus? 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: Mon, 28 Nov 2005 04:10:53 -0000 Nicolas Blais wrote: >As I was looking around the net for some information on pthreading in FreeBSD, >I came across something that got my attention: > >"The native user threads cannot concurrently run more than one thread on >separate processors at one time. If you are running a single process with >multiple CPU-intensive threads in hopes of utilizing multiple processors, you >must use Linuxthreads to get this performance." >(http://www.unobvious.com/bsd/freebsd-threads.html) > >Is this still applicable now (FreeBSD 5.4/6/CURRENT)? > >I'm writing a software that runs 1 process and multiple threads (with pthread) >that performs calculations and I was wondering if on a SMP system the threads >will run on an independant cpu. It would be quite pointless to have all >threads of the same process sharing a single cpu. > >Also, no matter how many threads I create within a process, 'top' only reports >2 threads. The following 'top' run reports my software ('aite') as using 2 >threads (when it actually created 4): > > so, what version of FreeBSD are you running? how many processors do you have? which threading library are you using? With libpthread you only create as amny kernel threads as you need at any instant. threads suspended in userland do not have associated kernel threads. >CPU states: 99.2% user, 0.0% nice, 0.8% system, 0.0% interrupt, 0.0% idle >Mem: 257M Active, 1422M Inact, 189M Wired, 85M Cache, 112M Buf, 49M Free >Swap: 2000M Total, 2000M Free > > PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND >89728 nicblais 2 20 0 4420K 2384K ksesig 0:18 77.44% aite > >Any insight appreciated, >Nicolas. > > > From owner-freebsd-threads@FreeBSD.ORG Mon Nov 28 11:02:54 2005 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 1C56016A41F for ; Mon, 28 Nov 2005 11:02:54 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D32343D53 for ; Mon, 28 Nov 2005 11:02:22 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id jASB2Gdu088352 for ; Mon, 28 Nov 2005 11:02:16 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id jASB2FEB088346 for freebsd-threads@freebsd.org; Mon, 28 Nov 2005 11:02:15 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 28 Nov 2005 11:02:15 GMT Message-Id: <200511281102.jASB2FEB088346@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Cc: Subject: Current problem reports assigned to you 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: Mon, 28 Nov 2005 11:02:54 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2005/01/26] threads/76690threads fork hang in child for (-lc_r & -lthr) 1 problem total. Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/07/18] kern/20016 threads pthreads: Cannot set scheduling timer/Can o [2000/08/26] kern/20861 threads libc_r does not honor socket timeouts o [2001/01/20] threads/24472threads libc_r does not honor SO_SNDTIMEO/SO_RCVT o [2001/01/25] threads/24632threads libc_r delicate deviation from libc in ha o [2001/01/25] kern/24641 threads pthread_rwlock_rdlock can deadlock o [2001/11/26] bin/32295 threads pthread dont dequeue signals o [2002/02/01] threads/34536threads accept() blocks other threads o [2002/05/25] kern/38549 threads the procces compiled whith pthread stoppe o [2002/06/27] threads/39922threads [threads] [patch] Threaded applications e o [2002/08/04] kern/41331 threads Pthread library open sets O_NONBLOCK flag o [2003/03/02] threads/48856threads Setting SIGCHLD to SIG_IGN still leaves z o [2003/03/10] threads/49087threads Signals lost in programs linked with libc s [2004/03/15] kern/64313 threads FreeBSD (OpenBSD) pthread implicit set/un o [2004/08/26] threads/70975threads unexpected and unreliable behaviour when o [2004/10/05] threads/72353threads Assertion fails in /usr/src/lib/libpthrea o [2004/10/07] threads/72429threads threads blocked in stdio (fgets, etc) are o [2004/10/21] threads/72953threads fork() unblocks blocked signals w/o PTHRE o [2004/12/19] threads/75273threads FBSD 5.3 libpthread (KSE) bug o [2004/12/21] threads/75374threads pthread_kill() ignores SA_SIGINFO flag o [2005/01/26] threads/76694threads fork cause hang in dup()/close() function o [2005/03/10] threads/78660threads Java hangs unkillably in STOP state after o [2005/04/08] threads/79683threads svctcp_create() fails if multiple threads o [2005/04/28] threads/80435threads panic on high loads o [2005/05/19] threads/81258threads Thread specific data is sometimes assigne o [2005/08/02] threads/84483threads problems with devel/nspr and -lc_r on 4.x s [2005/08/10] threads/84778threads libpthread busy loop/hang with Java when o [2005/08/20] threads/85160threads [libthr] [patch] libobjc + libpthread/lib o [2005/11/19] threads/89262threads [kernel] [patch] multi-threaded process h 28 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/06/13] kern/19247 threads uthread_sigaction.c does not do anything o [2000/10/21] kern/22190 threads A threaded read(2) from a socketpair(2) f o [2001/09/09] threads/30464threads pthread mutex attributes -- pshared o [2002/05/02] threads/37676threads libc_r: msgsnd(), msgrcv(), pread(), pwri s [2002/07/16] threads/40671threads pthread_cancel doesn't remove thread from o [2004/07/13] threads/69020threads pthreads library leaks _gc_mutex o [2004/09/21] threads/71966threads Mlnet Core Dumped : Fatal error '_pq_inse o [2004/11/21] threads/74180threads KSE problem. Applications those riched ma o [2005/04/13] threads/79887threads [patch] freopen() isn't thread-safe o [2005/05/13] threads/80992threads abort() sometimes not caught by gdb depen o [2005/05/26] threads/81534threads [libc_r] [patch] libc_r close() will fail 11 problems total.