tags:

views:

39

answers:

3

The man page for pthreads mentions:

 POSIX.1 also requires that threads share a range  of  other  attributes
       (i.e., these attributes are process-wide rather than per-thread):

       ...

       -  signal dispositions

       ...

What do "signal dispositions" mean?

+1  A: 

This means how Unix process reacts to signals. See signal(7).

Nikolai N Fetissov
+3  A: 

I signal disposition is the action a process takes when a signal is delivered. Each signal has a disposition. There are defaults.

From signal(7):

Signal Dispositions
    Each signal has a current disposition, which determines how the process
    behaves when it is delivered the signal.

[Dispositions are:]
    Term   Default action is to terminate the process.

    Ign    Default action is to ignore the signal.

    Core   Default action is to terminate the process and dump core (see core(5)).

    Stop   Default action is to stop the process.

    Cont   Default action is to continue the process if it is currently stopped.
[...]
    The signal disposition is a per-process attribute: in a multithreaded
    application, the disposition of a particular signal is the same for all
    threads.
Eric Towers
+2  A: 

The disposition of a signal is how it is handled.

  • It might be ignored
  • It might be handled using the default response (which depends on the signal)
    • stop
    • exit
    • exit with core dump
    • ignore
  • It might be handled by a user-defined signal handler

There can also be issues of signals masked while the signal handler is called, and so on.

Jonathan Leffler
Kedar Soparkar
@Kedar: more or less...I've not played with threads and signal handling, but my understanding is that a child thread inherits its parent thread's signal disposition; a thread can then alter its own disposition without affecting other threads (though any children it creates after changing the disposition inherit its then-current disposition, of course). However, you'd do best checking with the [POSIX](http://www.opengroup.org/onlinepubs/9699919799/toc.htm) standard on this, looking up pthread_create(), sigaction() and some of the general information.
Jonathan Leffler