|Anonymous | Login | Signup for a new account||2013-12-11 01:13 CET|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004127||OCaml||OCaml general||public||2006-10-02 16:01||2012-09-06 19:23|
|Reporter||Claudio Sacerdoti Coen|
|Target Version||later||Fixed in Version|
|Summary||0004127: Thread.sigmask not working under pthreads|
|Description||Thread.sigmask seems to be ignored.|
I attach an ocaml program and the "equivalent" C code.
The two programs set a signal handler for SIGINT and then create two more
threads. Each thread uses sigmask to block SIGINT. SIGINT should now be received
only from the parent thread. In Ocaml any thread can still receive the SIGINT,
as if Thread.sigmask behaves as the identity function.
|Tags||No tags attached.|
|Attached Files|| thread_mask.c [^] (636 bytes) 2006-10-02 16:01|
a.ml [^] (867 bytes) 2006-10-02 16:02
I confirm the problem. It comes from the fact that the set of pending signals is global rather than per-thread. There is no easy fix, but I keep that in my to do list.
I've been sleeping on this PR for way too long, so I'm un-assigning it from me.
Here is my analysis. The kernel delivers the signal to one of the threads that doesn't block it. However, if this thread is outside a blocking section, it cannot act on it immediately and instead records the signal as pending in a *global* data structure. Other threads poll this data structure periodically and can decide to handle the signal even if they block it themselves (or, more exactly, blocked it at the time the signal was received). In effect, Thread.sigmask is useless.
|2006-10-02 16:01||Claudio Sacerdoti Coen||New Issue|
|2006-10-02 16:01||Claudio Sacerdoti Coen||File Added: thread_mask.c|
|2006-10-02 16:02||Claudio Sacerdoti Coen||File Added: a.ml|
|2006-11-15 16:13||doligez||Status||new => acknowledged|
|2007-02-22 11:12||xleroy||Note Added: 0003932|
|2007-02-22 11:12||xleroy||Assigned To||=> xleroy|
|2007-02-22 11:12||xleroy||Status||acknowledged => confirmed|
|2011-12-17 09:49||xleroy||Note Added: 0006351|
|2011-12-17 09:49||xleroy||Assigned To||xleroy =>|
|2012-07-06 16:41||doligez||Target Version||=> 4.01.0+dev|
|2012-07-31 13:37||doligez||Target Version||4.01.0+dev => 4.00.1+dev|
|2012-09-06 19:23||frisch||Target Version||4.00.1+dev => later|
|Copyright © 2000 - 2011 MantisBT Group|