Synchronous input performance question


Barry Shein (bzs%bu-cs.bu.edu@bu-it.BU.EDU)
Sat, 14 May 88 23:43:12 EDT


>In unix systems it seems that you can block awaiting input on some socket in
>two ways. Either you use a blocking socket and then read (or block at
>a select call) and continue when input arrives, or have your
>socket set so that a SIGIO is generated when input arrives, at which
>point you do your read (or select) in your signal handler. The blocking
>can be achieved by using the sigpause call. In the later case, the socket
>can be non-blocking.
> The question is are there performance implications in using
>one approach over the other.

You'd probably do well directing questions like this to
unix-wizards@sem.brl.mil (I think that's the appropriate host name.)

Doing the read alone is clearly lower overhead as the signal mechanism
requires several things to happen as well as the ultimate read, you
pay what you get for. Whether it's "high" or "unacceptable" overhead
is an entirely differnet question and depends on the motivation which
brought the question up. If you were doing nothing but looping in data
I can't see any reason to incur the signal overhead. If you sometimes
needed the non-blocking behavior than you have a reason to do that,
etc etc.

        -Barry Shein, Boston University



This archive was generated by hypermail 2.0b3 on Thu Mar 09 2000 - 14:42:14 GMT