From owner-freebsd-hackers Tue Apr 20 13:36:56 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mercury.inktomi.com (mercury.inktomi.com [209.1.32.126]) by hub.freebsd.org (Postfix) with ESMTP id 318EA15857 for ; Tue, 20 Apr 1999 13:36:53 -0700 (PDT) (envelope-from jplevyak@inktomi.com) Received: from proxydev.inktomi.com (proxydev.inktomi.com [209.1.32.44]) by mercury.inktomi.com (8.9.1a/8.9.1) with ESMTP id NAA16910; Tue, 20 Apr 1999 13:34:33 -0700 (PDT) Received: (from jplevyak@localhost) by proxydev.inktomi.com (8.8.5/8.7.3) id NAA14260; Tue, 20 Apr 1999 13:34:25 -0700 (PDT) Message-ID: <19990420133425.G10370@proxydev.inktomi.com> Date: Tue, 20 Apr 1999 13:34:25 -0700 From: John Plevyak To: "Richard Seaman, Jr." , Luoqi Chen , John Plevyak Cc: hackers@FreeBSD.ORG Subject: Re: flock + kernel threads bug References: <199904201759.NAA15897@lor.watermarkgroup.com> <19990420111634.D10370@proxydev.inktomi.com> <19990420150902.A89750@tar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i In-Reply-To: <19990420150902.A89750@tar.com>; from Richard Seaman, Jr. on Tue, Apr 20, 1999 at 03:09:02PM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > POSIX threads specs require "threads" to have the same PID as the "process" > that spawns them. > > The current kernel structure in FreeBSD does not support this notion. > Once consequence is that posix kernel threads in FreeBSD will have > trouble being fully compliant, which affects at least signal handling > and the priority functions, and probably others (in addition to the > file locking issue raised here). Using p->p_leader to proxy for the > idea that each thread should have the same PID as the process is > helpful, but doesn't solve the problem completely. > > The better solution to this problem will come when/if there is better > support for the distinction between "kernel threads" and "processes". I fully agree. Given that kernel threads are currently implemented as processes it might be easiest to migrate to such a model by initially using struct proc for both processes and kernel threads and use 'p->p_leader->XXX' to access 'process' values including PID, and p->XXX to access 'thread' values. It may be prefereble to do a little rename p_leader -> p_proc. At some point it may be possible to bifricate 'struct proc' and 'struct thread'. john > > -- > Richard Seaman, Jr. email: dick@tar.com > 5182 N. Maple Lane phone: 414-367-5450 > Chenequa WI 53058 fax: 414-367-5852 > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message -- 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