Find the answer to your Linux question:
Results 1 to 4 of 4
i want my thread to take action upon some signal arrival, but i do NOT want my thread block calling sigwait() or something similar else, any hint?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2006
    Posts
    6

    how to register signal handler for thread?


    i want my thread to take action upon some signal arrival, but i do NOT want my thread block calling sigwait() or something similar else, any hint?

  2. #2
    Just Joined!
    Join Date
    Jan 2006
    Location
    India
    Posts
    52
    Hi ,

    I guess the main thread's attributes or resources like file descriptors,page table,
    Address space and signal hadlers are shared by the thread's in that group,

    Hence by registering the signal handlers in the main thread will also affect the thread's created in that group.

    I will confirm it once i verify it....

    -- rajesh

  3. #3
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    158
    pthread_sigmask allows you to set a singal mask on a per-thread basis.

    However.

    Each thread has it's own signal mask. But the signal disposition is shared by all threads in the process. This translates to -

    1. threads can block specific signals

    2. when one thread changes the action of a signal ALL threads share the new action .

    Dunno if that's what you want or not.

  4. #4
    Just Joined!
    Join Date
    Feb 2006
    Posts
    6
    what i want is: for a given signal, say signo , each thread has it own handler for signo, and the handlers may be different.
    does it possible?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •