From owner-freebsd-python@FreeBSD.ORG Wed Dec 10 13:35:38 2008 Return-Path: Delivered-To: freebsd-python@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15A44106570A for ; Wed, 10 Dec 2008 13:35:38 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from mail.tcbug.org (mail.tcbug.org [216.243.150.78]) by mx1.freebsd.org (Postfix) with ESMTP id E8FF98FC25 for ; Wed, 10 Dec 2008 13:35:37 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from roadrash.tcbug.org (c-24-118-145-206.hsd1.mn.comcast.net [24.118.145.206]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.tcbug.org (Postfix) with ESMTPSA id 8FCA4169E506; Wed, 10 Dec 2008 07:34:56 -0600 (CST) Message-ID: <493FC5A9.9020308@FreeBSD.org> Date: Wed, 10 Dec 2008 07:35:37 -0600 From: Josh Paetzel User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: Andrew MacIntyre References: <493ECB1E.2050709@FreeBSD.org> <493FA37E.2050502@bullseye.andymac.org> In-Reply-To: <493FA37E.2050502@bullseye.andymac.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-python@FreeBSD.org Subject: Re: A FreeBSD specific patch to python 2.5.2 X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 13:35:38 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andrew MacIntyre wrote: > Josh Paetzel wrote: > >> I work in a fairly python-centric environment, we use FreeBSD for all of >> our production machines. >> >> Recently we have started using the following patch to python 2.5.2 in >> production, and it's solved some issues we've had with regards to >> python, FreeBSD, threads, and signals. >> >> I've been contemplating whether it should be included in the FreeBSD >> port tree or not, and if it's included whether it should be optional, so >> on and so forth. >> >> Here's the patch >> >> - --- Python/thread_pthread.h.orig 2006-06-13 15:04:24.000000000 >> +0000 >> +++ Python/thread_pthread.h 2008-11-11 07:20:33.000000000 +0000 >> @@ -149,6 +149,7 @@ >> { >> pthread_t th; >> int status; >> + sigset_t set, oset; >> #if defined(THREAD_STACK_SIZE) || >> defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) >> pthread_attr_t attrs; >> #endif >> @@ -178,6 +179,8 @@ >> pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM); >> #endif >> >> + sigfillset(&set); >> + SET_THREAD_SIGMASK(SIG_BLOCK, &set, &oset); >> status = pthread_create(&th, >> #if defined(THREAD_STACK_SIZE) || >> defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) >> &attrs, >> @@ -187,7 +190,7 @@ >> (void* (*)(void *))func, >> (void *)arg >> ); >> - - >> + SET_THREAD_SIGMASK(SIG_SETMASK, &oset, NULL); >> #if defined(THREAD_STACK_SIZE) || >> defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) >> pthread_attr_destroy(&attrs); >> #endif > > Which versions of FreeBSD are you using this on? There are several > FreeBSD thread related issues in the Python bug tracker and it would be > useful to see if they can be squashed for the prospective 2.5.3 and 2.6.1 > releases... > 6.3-R and 6.4-R - -- Thanks, Josh Paetzel PGP: 8A48 EF36 5E9F 4EDA 5ABC 11B4 26F9 01F1 27AF AECB -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) iEYEARECAAYFAkk/xakACgkQJvkB8SevrssZJQCfdPOCfOoWmKVRSDtlbAI/Xk1M 7fUAmgJD847Y5Ue+6NTwbVhuKkHtstdq =0OD6 -----END PGP SIGNATURE-----