Xref: utzoo comp.unix.questions:24585 comp.unix.wizards:23405 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!aplcen!haven!ncifcrf!lhc!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: sockets and signals (in C) Message-ID: <25999@mimsy.umd.edu> Date: 12 Aug 90 23:25:15 GMT References: <3304@stl.stc.co.uk> <140492@sun.Eng.Sun.COM> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 22 >In article <3304@stl.stc.co.uk> Steve Perryman 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@sun.Eng.Sun.COM>, lm@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@cs.umd.edu Path: uunet!mimsy!chris (New campus phone system, active sometime soon: +1 301 405 2750)