tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Dynamically allocated locks



On Wed, Mar 26, 2008 at 09:09:16AM +0900, YAMAMOTO Takashi wrote:

> > Hi,
> > 
> > This patch allows for dynamically allocated locks.
> > 
> > http://www.netbsd.org/~ad/lockobj.diff
> > 
> > Each lock gets its own cache line, which can reduce cache coherency costs
> > when the lock is very active. The locks are reference counted so can be
> > shared between objects. That could be used for the two ends of a Unix socket
> > connection, or to share a lock between clone()d processes in order to
> > protect common state like signal actions, etc.
> 
> for these examples, aren't there more than a lock to be shared?

For sockets: I want to be able to do container based locking / "lock
chaining" similar to our scheduler, where the locks are objects in their
own right.

For processes, clone() is quite granular. It seems a lot easier to do
it this way rather than inventing another data structure to hang off
struct proc.

Andrew


Home | Main Index | Thread Index | Old Index