Subj : Re: nptl and signals To : comp.programming.threads From : Joe Seigh Date : Tue Jul 26 2005 11:55 am divijbhatt@gmail.com wrote: > > Joe Seigh wrote: > >>No, it's the rules of Posix that apply here. I don't know why you're >>mixing up signals and NPTL. What are you attempting to do with >>signals and threads? >> > > Hi, > See,I whether u r convinced or not that it is the rule of NPTL I am > gtng the same behaviour on my linux 2.6.10 kernel on FC2 with glibc > 3.3.3 > > 1.I am creating three threads in the main program > 2.I and setting the time for each thread in thread function using > setitimer() > 3.After the expiraton of timer SIGALRM is called which called signal() > asynchronously > 4.In signal handler function I am setting the flag > 5.In main function I am checking that if that flag is 1 then I do some > work there and again make that flag 0. > > But PROBLEM is:-------> > 1.I am not gtng signals properly in my signal handler function some > signals are dropping.The signals are deliverd to the threads randomly. That's allowable behavior. Using signals with threads is problematic so you shouldn't be suprised if you are running into problems. Signals predate threads and are a failed experiement. Use pthread_cond_timedwait() and your problems should go away. -- Joe Seigh When you get lemons, you make lemonade. When you get hardware, you make software. .