Re: Problem with infinite loop in signal handler

Mirski Paweł <[email protected]>
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <[email protected]>
Hello,
Not exactly infinite loop but sigsuspend. Infinite loop was only
example to show the problem. Without printf in sig handler problem
also occures.
I am writing simple stop-the-world garbage collector so I need this
construction to stop (almost)all threads in application. I think only
solution for this problem is not using any stream that client
application may use.
Thanks for help anyway :)

W dniu 26 lipca 2009 15:58 u¿ytkownik Gunnar Larisch
<[email protected]> napisa³:
> Hi Mirski,
>
> your signal handler function:
>
>> >> void suspend(int sig) {
>> >>    printf("suspending\n");
>> >>    fflush(stdout);
>> >>    while(1);
>> >> }
>
> Have you also tried your programm without calling printf and fflush in the
> signal handler? Do you know the manpage signal (7) ? There is a list of
> Async-signal-safe functions.
>
> Can you tell me, why you need an endless loop in the signal
> handler?
>
> Regards,
> Gunnar
>
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.