From owner-freebsd-ports@FreeBSD.ORG Fri Feb 6 18:12:00 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 2E48516A4CE for ; Fri, 6 Feb 2004 18:12:00 -0800 (PST) Received: from miffy.openlook.org (openlook.org [211.236.182.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 96F4243D2F for ; Fri, 6 Feb 2004 18:11:58 -0800 (PST) (envelope-from perky@miffy.openlook.org) Received: by miffy.openlook.org (Postfix, from userid 1000) id A27FDA9C2; Sat, 7 Feb 2004 11:14:09 +0900 (KST) Date: Sat, 7 Feb 2004 11:14:09 +0900 From: Hye-Shik Chang To: Daniel Eischen Message-ID: <20040207021409.GA33111@i18n.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Accept-Language: ko, en User-Agent: Mutt/1.5.5.1i cc: ports@freebsd.org cc: Julian Elischer Subject: Re: 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: Sat, 07 Feb 2004 02:12:00 -0000 On Fri, Feb 06, 2004 at 06:11:57PM -0500, Daniel Eischen wrote: > 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. Python uses system scope threads to make thread running run like more human-expected. (The discussion was here: http://groups.google.com/groups?threadm=slrn9ppgeb.mvb.bbrox%40bbland.bbrox.com&rnum=2) With system scope, it runs: % python ~/testthread.py thread 0 begin thread 1 begin thread 2 begin thread 3 begin thread 4 begin thread 0 end thread 1 end thread 3 end thread 2 end thread 4 end But with process scope, it runs: % ./python ~/testthread.py thread 0 begin thread 0 end thread 1 begin thread 1 end thread 2 begin thread 2 end thread 3 begin thread 3 end thread 4 begin thread 4 end Because our libc_r did system scope threads similar as process scope, python threads have been scheduled like the latter one on the previous FreeBSD releases. So even patching to use process scope threads on the port will not hurt backward-compatibility. Okay. I'll fix it on the port. Thanks for your investigation! KSE rocks! ;) Cheers, Hye-Shik