atom feed42 messages in org.freebsd.freebsd-threadssignal handler priority issue
FromSent OnAttachments
Sean McNeilJun 11, 2004 3:32 am 
Daniel EischenJun 11, 2004 4:18 am 
Daniel EischenJun 11, 2004 4:37 am 
Sean McNeilJun 11, 2004 4:41 am 
Daniel EischenJun 11, 2004 4:55 am 
David XuJun 11, 2004 5:01 am 
Sean McNeilJun 11, 2004 5:07 am 
David XuJun 11, 2004 5:15 am 
Sean McNeilJun 11, 2004 5:21 am 
Daniel EischenJun 11, 2004 5:29 am 
Sean McNeilJun 11, 2004 5:52 am 
David XuJun 11, 2004 6:00 am 
Daniel EischenJun 11, 2004 6:01 am 
Daniel EischenJun 11, 2004 6:05 am 
Sean McNeilJun 11, 2004 6:09 am 
Sean McNeilJun 11, 2004 6:25 am 
Sean McNeilJun 11, 2004 6:29 am 
Daniel EischenJun 11, 2004 6:41 am 
Daniel EischenJun 11, 2004 6:42 am 
Daniel EischenJun 11, 2004 7:15 am 
Sean McNeilJun 11, 2004 7:45 am 
Sean McNeilJun 11, 2004 8:04 am 
Sean McNeilJun 11, 2004 8:08 am 
Daniel EischenJun 11, 2004 8:10 am 
Daniel EischenJun 11, 2004 8:14 am 
Sean McNeilJun 11, 2004 8:16 am 
David XuJun 11, 2004 8:24 am 
Daniel EischenJun 11, 2004 8:26 am 
Sean McNeilJun 11, 2004 8:28 am 
Daniel EischenJun 11, 2004 8:32 am 
Daniel EischenJun 11, 2004 8:34 am 
Sean McNeilJun 11, 2004 8:37 am 
Sean McNeilJun 11, 2004 9:28 am 
David XuJun 11, 2004 2:42 pm 
Sean McNeilJun 11, 2004 5:42 pm 
Sean McNeilJun 11, 2004 6:08 pm 
Sean McNeilJun 11, 2004 6:15 pm 
David XuJun 11, 2004 10:44 pm 
Sean McNeilJun 11, 2004 11:18 pm 
David XuJun 11, 2004 11:33 pm 
David XuJun 12, 2004 1:01 am 
Sean McNeilJun 12, 2004 1:17 am 
Subject:signal handler priority issue
From:Daniel Eischen (eisc@vigrid.com)
Date:Jun 11, 2004 6:05:49 am
List:org.freebsd.freebsd-threads

On Thu, 10 Jun 2004, Sean McNeil wrote:

On Thu, 2004-06-10 at 22:29, Daniel Eischen wrote:

It can't keep going if there is a possibility that it can send the same thread another SIGUSR2.

I don't follow. Sorry.

If the master thread does:

for (i = 0; i < 4; i++) { pthread_kill(slave, SIGUSR1); sem_wait(&slave_semaphore); pthread_kill(slave, SIGUSR2); }

You can see that there is a potential race condition where the slave thread gets SIGUSR1 and SIGUSR2 very close together. It is even possible to get them together in one sigsuspend() (if they are both unmasked in the suspend mask).

You could fix the race by blocking SIGUSR1 from within the signal handler (like I described in my last email).

I take it then that when a signal handler is invoked that it's signal isn't masked while running. It isn't like a standard hardware interrupt then. I'm trying as you suggest and will post results.

Like I said before, it depends on the mask of the installed signal handler (sigact.sa_mask). You should use sigaction() and not signal() to get the desired behavior.

You're other output looked strange. I was expecting the "restart" count to start at 1, not 2.