From owner-freebsd-threads@FreeBSD.ORG Thu Jan 3 21:05:57 2008 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BACD716A54C for ; Thu, 3 Jan 2008 21:05:57 +0000 (UTC) (envelope-from gofdt-freebsd-threads@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 7346B13C46E for ; Thu, 3 Jan 2008 21:05:57 +0000 (UTC) (envelope-from gofdt-freebsd-threads@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JAXGE-0003wi-9P for freebsd-threads@freebsd.org; Thu, 03 Jan 2008 21:05:54 +0000 Received: from 78-0-90-175.adsl.net.t-com.hr ([78.0.90.175]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Jan 2008 21:05:54 +0000 Received: from ivoras by 78-0-90-175.adsl.net.t-com.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Jan 2008 21:05:54 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-threads@freebsd.org From: Ivan Voras Date: Thu, 03 Jan 2008 22:05:43 +0100 Lines: 33 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig4E7D4E2C509ACF61C53D1B22" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 78-0-90-175.adsl.net.t-com.hr User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) X-Enigmail-Version: 0.95.5 Sender: news Subject: Threads and signals 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: Thu, 03 Jan 2008 21:05:57 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig4E7D4E2C509ACF61C53D1B22 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, How do threads interact with signals? In particular, if I have a "main" process thread (the one started by main()) which generates items for a mutex-protected queue which are consumed by a worker thread, and I need to insert an item in the queue from the signal handler, am I correct that doing pthread_mutex_lock() from the signal handler could deadlock if the signal handler is executed by any of the threads (and the mutex is non-recursive)? How is this solved in general? By recursive mutexes? --------------enig4E7D4E2C509ACF61C53D1B22 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHfU4nldnAQVacBcgRAmYaAJ9otYyttlpdgswiBBpjPaLCgxJgEQCdFUpF tDXHVbYxeYKDtFMn5YZ8kNA= =ttN4 -----END PGP SIGNATURE----- --------------enig4E7D4E2C509ACF61C53D1B22--