Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 03 Jan 2008 22:05:43 +0100
From:      Ivan Voras <ivoras@freebsd.org>
To:        freebsd-threads@freebsd.org
Subject:   Threads and signals
Message-ID:  <fljin9$crb$1@ger.gmane.org>

next in thread | raw e-mail | index | archive | help
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--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fljin9$crb$1>