record locks and task death
Marcus Brinkmann <[email protected]>
| Newsgroups | gmane.os.hurd.devel.readers |
|---|---|
| Message-ID | <[email protected]> |
Hi, record locks have to be released at task death. Two strategies seems applicable. 1. The client creates a port and provides a send right to the server when requsting a lock. When the port is destroyed (normally at task death) the server receives a port death notification which it requested and can then clean up the lock structure. Of course, if the lock is released before that the server simply deallocates the send right. 2. The server returns a send right to a special lock port in the server to the user when a lock is requested. When the server receives a no senders notification, the lock is cleaned up. Of course, if the lock is released before that, the port is destroyed, turning the user's send right into a dead name. Nr 1 seems to be more appropriate as it puts the resource burden on the user. Neither is really pretty. Nr 2 looks more like as if a lock is an object in the server, which is also not bad. Of course, we are tightly bound to the POSIX semantics, which are just horrible, so we don't have much freedom. Of course, we don't have to guarantee that the task death is the reason for the lock release. The implicit behaviour, assuming that the user does not pass on the send or receive right to other tasks, is good enough to fulfill POSIX. What do you think? I was trying to find something that connects this to the io_close call, but however I look at it, it doesn't really get nice and pretty. Thanks, Marcus -- `Rhubarb is no Egyptian god.' GNU http://www.gnu.org [email protected] Marcus Brinkmann The Hurd http://www.gnu.org/software/hurd/ [email protected] http://www.marcus-brinkmann.de/