linux-um archives
 help / color / mirror / Atom feed
From: Rob Landley <rob@landley.net>
To: richard -rw- weinberger <richard.weinberger@gmail.com>
Cc: "user-mode-linux-devel@lists.sourceforge.net"
	<user-mode-linux-devel@lists.sourceforge.net>
Subject: Re: [uml-devel] How is Preemption implemented in User Mode Linux?
Date: Mon, 27 May 2013 16:27:45 -0500	[thread overview]
Message-ID: <1369690065.2776.33@driftwood> (raw)
In-Reply-To: <CAFLxGvy_SvjdTJ97DtCFubUAPgJ4tSgZi8LFYNHEwN94cUZLFQ@mail.gmail.com> (from richard.weinberger@gmail.com on Sun May 26 03:08:17 2013)

On 05/26/2013 03:08:17 AM, richard -rw- weinberger wrote:
> On Sun, May 26, 2013 at 1:01 AM, Hopsing K <hopsingk@gmail.com> wrote:
> > Some question at the side: can you call longjmp from within a signal
> > handler? My first assumption was that UML uses longjmp from within
> > the SIGALRM handler to implement preemption, butseems not to .

Yes, "man longjmp" shows you sigsetjmp() and siglongjmp(), which save  
and restore the signal mask. This is an important detail because the  
signal you're handling is disabled in the signal handler (to avoid an  
infinite loop). You can just setjmp() and longjmp() and fiddle with the  
signal mask yourself, but signals can nest (a different signal can  
interrupt a signal handler) so re-enabling just one may not be enough.

On return, the kernel re-enables the signal you were handling, even  
from nested signal handlers. But if you longjmp() you don't call the  
kernel return code...

Rob
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


      parent reply	other threads:[~2013-05-27 21:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-25 23:01 [uml-devel] How is Preemption implemented in User Mode Linux? Hopsing K
2013-05-26  8:08 ` richard -rw- weinberger
2013-05-26 14:48   ` Hopsing K
2013-05-26 15:26     ` richard -rw- weinberger
2013-05-27 21:27   ` Rob Landley [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=1369690065.2776.33@driftwood \
    --to=rob@landley.net \
    --cc=richard.weinberger@gmail.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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