From owner-freebsd-ports@FreeBSD.ORG Fri Feb 6 15:12:03 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6AB7716A4CE; Fri, 6 Feb 2004 15:12:03 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id C9B0543D45; Fri, 6 Feb 2004 15:12:01 -0800 (PST) (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 i16NBvfo020884; Fri, 6 Feb 2004 18:11:57 -0500 (EST) Date: Fri, 6 Feb 2004 18:11:57 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Julian Elischer In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: ports@freebsd.org cc: perky@freebsd.org Subject: Python and system vs process scope threads (was Re: python ports broken (sem_destroy: Resource temporarily) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2004 23:12:03 -0000 A brief synopsis: The python port uses system scope threads, or at least the test_threaded_import.py test in /usr/local/lib/python2.3/test does. Is there a reason python uses system scope threads instead of process scope threads? It is more efficient and consumes less resources in FreeBSD if it were to use scope process threads. You can use either system or process scope threads, or even have a mix of them in FreeBSD, but I wonder if python just defaults to system scope threads because that is what Linux and now Solaris threads default to. On Fri, 6 Feb 2004, Julian Elischer wrote: > > On Fri, 6 Feb 2004, Daniel Eischen wrote: > > > > > > Why? > > > > System scope threads each have their own KSEG/KSE pair. > > The default thread limits in the kernel are: > > > > kern.threads.max_threads_per_proc: 150 > > kern.threads.max_groups_per_proc: 50 > > > > By default there are 2 KSEGs for a threaded process in > > libpthread: one for scope process threads and one for > > the signal handling thread. That leaves 48 for left for > > application use. > > > > Those limits are arbitrary, so you can raise/lower them > > if you don't like them. I thought you came up with those > > limits ;-) > > > I know all that :-) > > Why do they make system scope threads? > :-) > couldn't part of a freebsd port patch be to make them process scoe > threads.. it'd be more efficient.. > > > > > -- > > Dan Eischen > > > > > -- "Some folks are into open source, but me, I'm into open bar." -- Spencer F. Katt