From owner-freebsd-hackers Sat Aug 2 16:53:24 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id QAA22567 for hackers-outgoing; Sat, 2 Aug 1997 16:53:24 -0700 (PDT) Received: from mail.webspan.net (root@mail.webspan.net [206.154.70.7]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id QAA22562 for ; Sat, 2 Aug 1997 16:53:21 -0700 (PDT) Received: from orion.webspan.net (orion.webspan.net [206.154.70.5]) by mail.webspan.net (WEBSPAN/970608) with ESMTP id TAA05915; Sat, 2 Aug 1997 19:53:19 -0400 (EDT) Received: from orion.webspan.net (localhost [127.0.0.1]) by orion.webspan.net (WEBSPAN/970608) with ESMTP id TAA21592; Sat, 2 Aug 1997 19:53:19 -0400 (EDT) To: Terry Lambert cc: hackers@FreeBSD.ORG From: "Gary Palmer" Subject: Re: non-blocking file i/o In-reply-to: Your message of "Sat, 02 Aug 1997 16:02:09 PDT." <199708022302.QAA00445@phaeton.artisoft.com> Date: Sat, 02 Aug 1997 19:53:19 -0400 Message-ID: <21590.870565999@orion.webspan.net> Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Terry Lambert wrote in message ID <199708022302.QAA00445@phaeton.artisoft.com>: > > A friend (who mainly does his devel under solaris/linux) recently came > > up with a patch to the INN database code which made the writes > > non-blocking. On linux/solaris, the non-blocking writes would take > > fractions of a ms. On FreeBSD, the blocking write took 8ms and the > > ``non-blocking'' write took 4ms (set using fcntl). It also seems that > > Linux and Solaris use open(file, O_NONBLOCK, 0) to put the file into > > non-blocking mode for reading and writing also, where our open flag > > only affects the open. > > Are you confusion O_NONBLOCK with O_NDELAY? There is no difference on FreeBSD. For files, they are both NOPS. > It used to be on SysV systems that O_NDELAY was "open without waiting > for DCD on modem control devices" and *also* put the device into > non-blocking mode. No idea. I don't have a linux/solaris system to play with (not quite true, but I'm not touching the Solaris/x86 box here more than I have to). All I *DO* know, is when the file was opened with O_NONBLOCK, both Solaris and Linux recorded write() times in fractions of a milisecond. FreeBSD consistantly recorded write() times in the order of 8ms on my test box. Gary -- Gary Palmer FreeBSD Core Team Member FreeBSD: Turning PC's into workstations. See http://www.FreeBSD.ORG/ for info