![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Replacing Carriage returns without loosing EOL | Majiktom | Shell Programming and Scripting | 2 | 03-08-2008 04:28 AM |
| replace ascii chars without loosing it. | braindrain | Shell Programming and Scripting | 4 | 02-01-2006 07:02 AM |
| How to install FreeBSD without loosing my data? | sualcavab | UNIX for Dummies Questions & Answers | 0 | 12-05-2005 01:02 AM |
| Linux without loosing Win9x | merlinpr | UNIX for Dummies Questions & Answers | 2 | 06-27-2001 12:48 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Loosing signals even with sigqueue
Hi everyone,
I have a process that forks many times.At a random time point the children must send a SIGUSR1 to the parent.To do that I'm using a pair of sigaction & sigqueue.However many signals are getting lost. Here are some code segments: a)sigaction Code:
sigset_t mask_set; /* used to set a signal masking set. */ sigfillset(&mask_set); struct sigaction act; act.sa_sigaction=catch_usr1; act.sa_mask=mask_set; act.sa_flags=SA_SIGINFO | SA_RESTART; sigaction(SIGUSR1,&act,NULL); Code:
void catch_usr1(int sig,siginfo_t *a,void *b )
{
sigcount++;
if (readers>0)
readers--;
else
writing=false;
printf("[LOG] Signal received. Readers now: %d Signal counter: %d\n",readers,sigcount);
fflush(stdout);
}
Code:
tmp=sigqueue(getppid(),SIGUSR1,vsig); Last edited by jonas.gabriel; 12-12-2006 at 02:48 AM. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
You didn't post the code surrounding your sigqueue call. The call should fail with EAGAIN if the queue is currently full.
|
|
#3
|
|||
|
|||
|
I just have this simple statements
Code:
tmp=sigqueue(getppid(),SIGUSR1,vsig);
close(handler.connfd);
printf("SERVER CHILD for %d: Out.Sigqueue returned %d\n",handler.id>0?handler.id:-handler.id,tmp);
fflush(stdout);
return 0;
Last edited by jonas.gabriel; 12-12-2006 at 08:18 AM. |
|
#4
|
|||
|
|||
|
Quote:
|
|
#5
|
||||
|
||||
|
Quote:
Quote:
|
|
#6
|
|||
|
|||
|
Apparently the linux kernel maintainers were misinformed, then. An old design flaw in the linuxthreads system is that, if the signal queue overflows and it's never informed of it, causing thread termination signals to stop being delivered, resulting in something very odd -- zombie threads. They couldn't fix it as it was a design flaw rather than a bug, and the kernel maintainers insisted that error status was not required. nptl doesn't have the same issues fortunately.
|
|
#7
|
|||
|
|||
|
So it isn't a fault of mine. I'm working already on a solution based on sockets using select.Should I reject signals as solution to my problem ? Reability of delivery is important to me.What is your opinion ?
|
|||
| Google The UNIX and Linux Forums |