From owner-freebsd-current Sat Nov 30 14:54:34 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 953F637B401 for ; Sat, 30 Nov 2002 14:54:33 -0800 (PST) Received: from avocet.mail.pas.earthlink.net (avocet.mail.pas.earthlink.net [207.217.120.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B2C143EAF for ; Sat, 30 Nov 2002 14:54:33 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from pool0348.cvx22-bradley.dialup.earthlink.net ([209.179.199.93] helo=mindspring.com) by avocet.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 18IGVL-0002l5-00; Sat, 30 Nov 2002 14:54:31 -0800 Message-ID: <3DE94158.142E1B67@mindspring.com> Date: Sat, 30 Nov 2002 14:53:12 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Daniel Eischen Cc: Brian Smith , "current@FreeBSD.ORG" Subject: Re: Are SysV semaphores thread-safe on CURRENT? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Daniel Eischen wrote: > > No, libc_r doesn't properly handle flock. Usually, all syscalls > > that take file descriptors as arguments honor the non-blocking > > mode of the file if set. I guess flock(2) doesn't and has its > > own option to the operation argument (LOCK_NB). > > > > I hacked libc_r to periodically check (every 100msecs) the > > flock. See if this fixes things: Same thing I suggested, only I think he was really using fcntl(), not flock()? My patch wasn't integral to the library (it was more of a hack), and my default time was 1S, not 100uS. Same non-FIFO request ordering, too. 8-(. I guess the real question is what is an fcntl()/flock() supposed to do on a blocking call against a non-blocking fd? I could not tell, so I punted. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message