This mistake is exactly the reason that Netscape 4.x freezes from time
to time on Linux.
It tries to write too many things to a pipe, making the assumption that
this will never happen.
The correct thing to do, which never freezes, is to maintain a queue or
other structure inside your own process. Just write a single byte to
the pipe when a condition flag becomes true for the first time, after
setting the flag (both inside the signal handler). Clear the flag and
handle the pending conditions whenever you read the byte in the select()
loop. A flag can be implemented as a pair of counters if you can't do
atomic sets and clears.
enjoy,
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/