sockets and signals (in C)

Chris Torek chris at mimsy.umd.edu
Mon Aug 13 09:25:15 AEST 1990


>In article <3304 at stl.stc.co.uk> Steve Perryman <skp at stl.stc.co.uk> asks
>>[for] a way to set up a signal handler such that [...] a variable can be
>>incremented to represent the correct number of data items at the socket.

In article <140492 at sun.Eng.Sun.COM>, lm at snafu.Sun.COM (Larry McVoy) writes:
>This can't be done with Unix signals.  Unix signals don't stack ....

This is true (even with BSD or POSIX reliable signals); however:

>About the best you can do for you application is to use sigio as a hint that
>there is data waiting and schedule a timeout every second or so to collect
>what you might have missed.

This is not necessary.  With reliable signals and non-blocking I/O (or
select()) it is possible to code reliable interrupt handlers, just as
it is possible to code relible interrupt handlers on `bare hardware'
(except with certain pathological hardware systems).  It is tricky,
however.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris
	(New campus phone system, active sometime soon: +1 301 405 2750)



More information about the Comp.unix.questions mailing list