bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Signals, messages and exceptions


From: Thomas Bushnell BSG
Subject: Re: Signals, messages and exceptions
Date: Fri, 01 Dec 2006 12:30:50 -0800

On Fri, 2006-12-01 at 15:03 -0300, Leonardo Pereira wrote:
> I think he isn't, Mach Exceptions are just another aproach of signals,
> they were used on Mach_US and Lites to implement Unix-compatible
> signals. The unique 'problem' is that Mach Exceptions handle not only
> process but also threads, so, this is a very fundamental difference.

No, both you and Igor are missing the point.  Mach exceptions are *also*
just messages sent between tasks.  Igor seems to think that there is
some "duplication" going on, when in fact, we have a Mach thing (an
exception) which we need to reflect as a Posix signal for programs that
only know about signals.

It is obligatory to map Mach exceptions to signals, because Posix-aware
and Mach-ignorant programs should get the expected signals for machine
faults and the like.

However, a program that understands Mach exceptions is certainly able to
handle the exceptions itself, directly, by putting its own exception
handler in place and then libc's (which does the mapping) will not be
used.  One can even arrange to handle some exceptions yourself, and
forward the others on to the default handler in libc.

Leonardo is missing the point, in thinking that exceptions are another
approach to signals; they are in fact fundamentally different.  When a
Mach thread encounters an exceptional condition, the thread is
suspended, and a message is sent.  The message can be handled by
anything else in the system, with one exception: it cannot be handled by
the faulting thread, because that thread is suspended.

Posix signals are not like this at all; a Posix signal does not suspend
anything; instead, the exceptional condition is handled on the stack of
the faulting process by directly munging its instruction pointer and
such.  This has all kinds of problems, and the cleanliness and sanity of
the Mach approach is clearly the right way to go in a multi-threaded
system with message passing.

However, that doesn't mean we can ignore Posix.  Igor sees duplication,
but I wonder what he thinks should happen when a process gets a Mach
exception, for ordinary programs which do nothing special.

Thomas


Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]