linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: xcomp@arcor.de
To: linux-c-programming@vger.kernel.org
Subject: Is it bad to let a signal handler stay alive for a long time
Date: Wed, 28 Jan 2009 19:58:18 +0100 (CET)	[thread overview]
Message-ID: <16930643.1233169098680.JavaMail.ngmail@webmail14.arcor-online.net> (raw)

Hi all,
I am still thinking about a preemptive scheduling implementation in user-mode. Therefore I have switched from using setcontext to calling swapcontext in the signal handler. This approach seems to solve the problem I had with setcontext in the signal handler (in my test program for loops does not finished correctly in every case).
But now I ran into another question: If I am using swapcontext inside the signal handler its context stays alive for a long time (because other contexts are running before the handler can finish its work). I didn't find any trouble caused by this till now. But I've found also many sites where they say that a signal handler should include only a small amount of code so that it can finish fast.
So my questions are: Can anyone explain, why it is still a bad idea to use swapcontext inside the signal handler, although there seem to be no problems with it? If there are, which problems can occur? Does anyone has a good idea for a stress test in order to find problems? Simply running a huge number of code does not seem to be enough.
I appreciate any responds.

Thx,
Matthias

Erwischt! Bei Arcor sehen Sie die besten Promi-Bilder riesengroß und in Top-Qualität. Hier finden Sie die schönsten Schnappschüsse auf dem roten Teppich, lernen die Frauen des Womanizers Boris Becker kennen und schauen den Royals ins Wohnzimmer. Viel Spaß auf Ihrer virtuellen Reise durch die Welt der Stars und Sternchen: http://vip.arcor.de.
--
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

             reply	other threads:[~2009-01-28 18:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-28 18:58 xcomp [this message]
2009-01-29 19:21 ` Is it bad to let a signal handler stay alive for a long time Glynn Clements

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=16930643.1233169098680.JavaMail.ngmail@webmail14.arcor-online.net \
    --to=xcomp@arcor.de \
    --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).