From: "Mirski Paweł" <mirskip87@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: Re: Problem with infinite loop in signal handler
Date: Tue, 28 Jul 2009 08:45:42 +0200 [thread overview]
Message-ID: <62c21b850907272345s34829764m41763d41e54c65a@mail.gmail.com> (raw)
In-Reply-To: <20090726135838.GA5951@balu.adler.nest>
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
<gunmuc@googlemail.com> 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2009-07-28 6:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-22 16:42 Problem with infinite loop in signal handler Mirski Paweł
2009-07-22 20:31 ` Gedare Bloom
2009-07-25 5:34 ` Mirski Paweł
2009-07-26 13:58 ` Gunnar Larisch
2009-07-28 6:45 ` Mirski Paweł [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=62c21b850907272345s34829764m41763d41e54c65a@mail.gmail.com \
--to=mirskip87@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).