From owner-freebsd-current@FreeBSD.ORG Sun May 2 09:57:54 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 92BAE16A4CE for ; Sun, 2 May 2004 09:57:54 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44C5B43D2D for ; Sun, 2 May 2004 09:57:54 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i42GvrS8006257; Sun, 2 May 2004 12:57:53 -0400 (EDT) Date: Sun, 2 May 2004 12:57:53 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Alexandre Sunny Kovalenko In-Reply-To: <20040502105310.365f91e3.Alex.Kovalenko@verizon.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-current@freebsd.org Subject: Re: Is it possible to make -lpthread program to use 100% CPU? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2004 16:57:54 -0000 On Sun, 2 May 2004, Alexandre Sunny Kovalenko wrote: > > I did mention this one ;) With older sources (kern_thread.c 1.175) I have tried > both with the similar results. With the last update (last CTM from EST morning > on Friday 4/30) I only tried _ULE. If you need me to try _4BSD, let me know. > > Just out of curiosity, if I have 64 threads and 4 CPUs would not result be the > same with PTHREAD_SCOPE_SYSTEM and PTHREAD_SCOPE_PROCESS, since I could not > get more KSEGs then I have CPUs, and default is 8 threads per KSEG? Or am I > totally off the mark? You can have more KSEGs than CPUs. The default is one KSEG with N KSEs (where N is the number of CPUs). All scope process threads run in the N KSEs; these threads are not bound to any specific KSE within the KSEG. Scope system threads get their own KSEG and KSE. I don't know how the various schedulers schedule KSEs onto processors. -- Dan Eischen