From owner-freebsd-hackers Tue Apr 20 19:27:55 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from lor.watermarkgroup.com (lor.watermarkgroup.com [207.202.73.33]) by hub.freebsd.org (Postfix) with ESMTP id 74672155D4 for ; Tue, 20 Apr 1999 19:27:50 -0700 (PDT) (envelope-from luoqi@watermarkgroup.com) Received: (from luoqi@localhost) by lor.watermarkgroup.com (8.8.8/8.8.8) id WAA20594; Tue, 20 Apr 1999 22:24:50 -0400 (EDT) (envelope-from luoqi) Date: Tue, 20 Apr 1999 22:24:50 -0400 (EDT) From: Luoqi Chen Message-Id: <199904210224.WAA20594@lor.watermarkgroup.com> To: dick@tar.com, jplevyak@inktomi.com Subject: Re: flock + kernel threads bug Cc: hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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