Date:        Tue, 13 Jun 2023 16:38:54 -0500
    From:        "G. Branden Robinson via austin-group-l at The Open Group" 
<[email protected]>
    Message-ID:  <20230613213854.hk3z6zzpkhdiunsk@illithid>

  | I apologize for the possibly academic recapitulation of multitasking,
  | but the key point is that the foregoing model does not require the
  | process to "enter the kernel" to service the signal.

"enter" was perhaps a poor choice of words, for the general case, "be in"
might be better.

But Geoff's message, to which I was replying, said:

        is currently running, and is executing user code.

A process in that state was the one to which I was referring.   Such
a process must actually enter the kernel (since it is not there at the
time) in order for the kernel to deliver a signal to it.

And yes, there is something about kernel design being assumed here, but
that's not particularly important to anything.  The issue was that even
in that case, the signal is pending for some period (usually a very short
period, perhaps just a few microseconds, but also possibly longer).
It is never true, even in the simplest case:
        kill(getpid(), SIGwhatever)
that the signal is not pending for some period.   Even when that system
call results in no context switch, and "immediately" invokes the application's
SIGwhatever handler, there is a brief period, between when the signal is
posted, and the handler is invoked.   During that period, the signal is
pending, as that is defined.   This one, on a fast processor, may be for
considerably less than a microsecond, but it is never zero.

  | There's arguably not much difference between your presentation and mine;
  | in mine, something special and kernelly _might_ need to happen when
  | returning from the signal handler,

returning from the signal handler isn't the issue, it is calling it in
the first place.   Signals are kernel events, for the application handler
to be invoked (in application space, running application code) the kernel
needs to be running, to set up the application environment.   While the
application could have something resembling signal handlers which operate
entirely without kernel assistance, those would not be actual signal
handlers.

  | No mode switch is necessary.

[when returning from a signal handler] - that's true in most cases, but
not if the signal handler blocked signals as part of its invocation.
In that case, some kind of call to the kernel is needed to return the
signal mask to its state before the handler was invoked.

  | I guess the question from the POSIX perspective is whether a signal can
  | be pending if a process cannot observe it to be.

I don't think that matters.   The notion is used as a mechanism to allow
the existence of signals which do not get immediately delivered to the
process.

  | That's good.  I surmise, then, that "signal
  | pendingness" is not a trait that POSIX needs to define, or even employ.

Perhaps not, but it does.

  | The standard should avoid the term if using it--even just for expository
  | purposes--is going to provoke controversy among highly seasoned Unix
  | kernel engineers who are accustomed to using it with a more
  | implementation-specific meaning.

No, there has been no controversy here about what that means (with the
slight glitch when I didn't bother to look at the POSIX definition, and
thought that possibly only unblocked signals were considered pending,
but that was just my laziness coming through).   The recent discussion
has been entirely about how to write down the notion that a signal might
be delivered to a process while it is executing the function that unblocks
(other) signals.

kre

ps: SIGQUIT is not an "un-handleable signal" - the only signals that cannot
be caught, are SIGKILL and SIGSTOP.   There's nothing particularly special
about SIGQUIT at all.


  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
    • Re: [10... Geoff Clare via austin-group-l at The Open Group
    • Re: [10... Robert Elz via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • Re: [1003.1(... Robert Elz via austin-group-l at The Open Group
    • Re: [10... G. Branden Robinson via austin-group-l at The Open Group
    • Re: [10... Robert Elz via austin-group-l at The Open Group
      • Re:... G. Branden Robinson via austin-group-l at The Open Group
      • Re:... Robert Elz via austin-group-l at The Open Group
    • Re: [10... Scott Lurndal via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group

Reply via email to