Date: Tue, 20 Apr 1999 17:57:41 -0700 From: John Plevyak <jplevyak@inktomi.com> To: Luoqi Chen <luoqi@watermarkgroup.com>, dick@tar.com, jplevyak@inktomi.com Cc: hackers@FreeBSD.ORG Subject: Re: flock + kernel threads bug Message-ID: <19990420175741.H10370@proxydev.inktomi.com> In-Reply-To: <199904202119.RAA17889@lor.watermarkgroup.com>; from Luoqi Chen on Tue, Apr 20, 1999 at 05:19:57PM -0400 References: <199904202119.RAA17889@lor.watermarkgroup.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Apr 20, 1999 at 05:19:57PM -0400, Luoqi Chen wrote: > No, this is not an issue of separate task and thread structures. You may > have the same problem for two separate processes that share file descriptor > table, and john's fix would not work for this case. The correct solution > to this problem (in my opinion) is to clear all POSIX locks upon closure > of a file descriptor, which requires we keep in the file descriptor table > a list of procs that reference it. > > -lq 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, 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. 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 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?19990420175741.H10370>