make-alpha
[Top][All Lists]
Advanced

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

Re: GNU make jobserver redux


From: Paul Eggert
Subject: Re: GNU make jobserver redux
Date: Mon, 7 May 2001 17:33:21 -0700 (PDT)

> Date: Mon, 7 May 2001 09:57:48 -0400
> From: "Paul D. Smith" <address@hidden>

> However, your way is much safer if signal handler management is not
> expensive.

For what it's worth, I found the oldest, slowest machine I could -- an
70 MHz Microsparc II running Solaris 8 -- and found that it took about
42 microseconds to clear and then set the SA_RESTART flag.
Conversely, a more modern but not superfast host (a 650 MHz PIII
running GNU/Linux 2.2) took about 2.6 microseconds for the same task.

> .. reap_children() has a well-defined set of code that it can
> reach, but there's a decent amount of it.

Yes, that was mostly my concern.  I don't know the code as well as you
do, so I played safe.  Also, I had the vague (and perhaps incorrect)
impression that the loop normally iterates only once, so there's not
that much benefit to hoisting the code out of the loop.

I also toyed with the idea of mutating your test program into an
autoconfiguration gizmo that would let 'make' avoid the signal handler
management on hosts that don't need it, but decided I didn't have the
time -- and anyway, a build-time test might not give results that are
reliable for run-time, e.g. failures might occur only on
multiprocessor hosts.

By the way, I looked at POSIX.1-200x draft 6, and it wasn't very clear
on the subject.  So I proposed adding the following to the rationale:

"If a signal-catching function returns while the SA_RESTART flag is in
effect, an interrupted function is restarted at the point it was
interrupted.  Portable applications cannot make assumptions about the
internal behavior of interrupted functions, even if the functions are
async-signal-safe.  For example, suppose the read() function is
interrupted with SA_RESTART in effect, the signal-catching function
closes the file descriptor being read from and returns, and the read()
function is then restarted; in this case the application cannot assume
that the read() function will give an [EBADF] error, since read()
might have checked the file descriptor for validity before being
interrupted."



reply via email to

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