Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Dec 1999 04:41:33 -0800 (PST)
From:      Alfred Perlstein <bright@wintelcom.net>
To:        arch@freebsd.org
Subject:   interface ideas for async locks?
Message-ID:  <Pine.BSF.4.21.9912210428380.12109-100000@fw.wintelcom.net>

next in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.9912210428380.12109-100000>