From owner-freebsd-arch Tue Dec 21 4:10: 1 1999 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id 462311534E for ; Tue, 21 Dec 1999 04:09:58 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id NAA16996 for ; Tue, 21 Dec 1999 13:09:56 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id NAA25608 for freebsd-arch@freebsd.org; Tue, 21 Dec 1999 13:09:54 +0100 (MET) Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id D9B7B1528B for ; Tue, 21 Dec 1999 04:09:43 -0800 (PST) (envelope-from bright@wintelcom.net) Received: from localhost (bright@localhost) by fw.wintelcom.net (8.9.3/8.9.3) with ESMTP id EAA29537 for ; Tue, 21 Dec 1999 04:41:33 -0800 (PST) Date: Tue, 21 Dec 1999 04:41:33 -0800 (PST) From: Alfred Perlstein To: arch@freebsd.org Subject: interface ideas for async locks? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I've gotten started on making async fcntl locks possible, the trick is giving preference to async locks and having lock reservations put up by the process that 'unblocks' the async lock. Anyhow, the reason for this mail is to get an idea of what type of interface people would like for this feature. Right now the way I have envisioned it is: process makes a lock request 'F_GETLKA', if the lock is aquired immediatly then success is returned, if not it errors out and sets errno to EINPROGRESS. later when the lock becomes available SIGIO will be posted to the process that put the lock up, the process can then call a syscall that will attempt to give them the actual lock. getasynclocks(int n, struct flock *fl), The program would pass in a number indicating the size of the flock array, then the system would loop attempting to grant those locks and copy in the data for each lock into the flock array. the syscall would return the number of locks granted. Can anyone think of a nicer interface? thanks, -Alfred Perlstein - [bright@rush.net|alfred@freebsd.org] Wintelcom systems administrator and programmer - http://www.wintelcom.net/ [bright@wintelcom.net] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message