Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 1999 22:24:50 -0400 (EDT)
From:      Luoqi Chen <luoqi@watermarkgroup.com>
To:        dick@tar.com, jplevyak@inktomi.com
Cc:        hackers@FreeBSD.ORG
Subject:   Re: flock + kernel threads bug
Message-ID:  <199904210224.WAA20594@lor.watermarkgroup.com>

next in thread | raw e-mail | index | archive | help
> I think the problem is a little different since you need
> to clear all the lock when the process termintes whereas for threads
> you do not remove the locks when the thread terminates (only
> when the last thread in the process terminates).  Implementationally,

Termination is not a problem, locks won't be cleared (fd not closed) as
long as the reference count of the fd table is not zero, it is the explicit
close() by any of the threads.

> you could trigger that off the close with a list in the file descriptor 
> table, which would solve the problem of shared file descriptor tables
> by non-threads, but you still need to store the 'process id' 
> instead of the 'thread id' for locks by threads which is what my patch 
> is doing.

This is a different (bigger) problem, i.e. pid sharing among threads,
it is also desirable for signal handling. I doubt that which id is stored in
the lock really matters, and this issue will go away as soon as we solve
the bigger pid sharing problem.

For the current problem at hand, we want a solution that works for both
threads and non-threads.

> 
> john
> 
> -- 
> John Bradley Plevyak,    PhD,    jplevyak@inktomi.com,     PGP KeyID: 051130BD
> Inktomi Corporation,  1900 S. Norfolk Street,  Suite 310,  San Mateo, CA 94403
> W:(650)653-2830 F:(650)653-2889 P:(888)491-1332/5103192436.4911332@pagenet.net
> 

-lq


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904210224.WAA20594>