sigwait in multi-threaded application

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Are there any caveats of sigwait (on RT signals) in
multithreaded application?

As suggested in the man page, i call 

# define SIG35 35
# define SIG36 36

sigaddset (&set, SIG36) ;
pthread_sigmask (SIG_BLOCK, &set, NULL);

at the beginning of the program (in main) before I
create any threads.

Then i register a signal handler for SIG35. The signal
handler i call sigwait for SIG36 as

    sigaddset (&set, SIG36) ; 
    pthread_sigmask (SIG_BLOCK, &set, NULL) ;      
    sigwait (&set, &signum) ; 
    if (signum == SIG_TASKRESUME)
    {
        printf ("Task is received SIG36\n") ;
    }

Is this usage right? I see that some times if run
strace on the particular thread that is currently in
sigwait and then kill strace with Ctrl+C, the threads
starts hogging CPU? Why should Ctrl+C wake up sigwait
on SIG36??

Am I missing something?  (Linux 9, 2.4 kernel)

Regards,
Pav.



		
__________________________________________________________
How much free photo storage do you get? Store your friends 'n family snaps for FREE with Yahoo! Photos http://in.photos.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux