From owner-freebsd-hackers Sun Apr 7 18:58:29 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id SAA18604 for hackers-outgoing; Sun, 7 Apr 1996 18:58:29 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id SAA18599 for ; Sun, 7 Apr 1996 18:58:24 -0700 (PDT) Received: from msmith@localhost by genesis.atrad.adelaide.edu.au (8.6.12/8.6.9) id LAA08178; Mon, 8 Apr 1996 11:53:08 +0930 From: Michael Smith Message-Id: <199604080223.LAA08178@genesis.atrad.adelaide.edu.au> Subject: Re: The F_SETOWN problem.. To: terry@lambert.org (Terry Lambert) Date: Mon, 8 Apr 1996 11:53:07 +0930 (CST) Cc: louie@TransSys.COM, msmith@atrad.adelaide.edu.au, roell@blah.a.isar.de, terry@lambert.org, hackers@FreeBSD.ORG, jkh@time.cdrom.com, roell@xinside.com In-Reply-To: <199604071939.MAA00383@phaeton.artisoft.com> from "Terry Lambert" at Apr 7, 96 12:39:52 pm MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Terry Lambert stands accused of saying: > > > While not an X server application, you'll note that xntpd uses SIGIO > > so that it might read and, most importanty, timestamp traffic arriving > > on the network. This is critical to making NTP accurately synchronize > > the clock. By using SIGIO, you can not have to worry nearly so much > > about long-running sections of code and not being able to check for > > pending input for a "long" time. The model of signal as 'interrupt' > > works extremely well for this sort of appliation. Of course, this all > > works Just Fine with sockets.. > > Signals are not events. What is wrong with select() that makes it > unsuitable for your use? The point is that as soon as the process involved runs again, its signal handler runs, effectively overriding any internal scheduling it is performing using select(). Imagine that you are using select() to watch several stream connections, and a large body of data appears on one. You bounce off and digest as much of it as possible, in the name of efficiency. This may take some time, and while you are doing it, you _won't_ be selecting on the other streams. So if one of these other streams wants attention, you lose. However, if you can get a signal when it wants attention, you can spend as long as you like being efficient with your bulk data, and still respond in a timely fashion to events that require it. select() is good for multiplexing, and efficient processing of bulk data. select() is _bad_ for rapid response to data. SIGIO is a convenient (but not necessarily appropriate) alternative that would be _bad_ for bulk data, but good for handling asynchronous arrival of exceptional data. > So it's not like you get increased response time or anything. Ah, but you do. It's just that you're thinking of the wrong scheduler. > Terry Lambert -- ]] Mike Smith, Software Engineer msmith@atrad.adelaide.edu.au [[ ]] Genesis Software genesis@atrad.adelaide.edu.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control (ph/fax) +61-8-267-3039 [[ ]] Collector of old Unix hardware. "Where are your PEZ?" The Tick [[