Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 1999 13:34:25 -0700
From:      John Plevyak <jplevyak@inktomi.com>
To:        "Richard Seaman, Jr." <dick@tar.com>, Luoqi Chen <luoqi@watermarkgroup.com>, John Plevyak <jplevyak@inktomi.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: flock + kernel threads bug
Message-ID:  <19990420133425.G10370@proxydev.inktomi.com>
In-Reply-To: <19990420150902.A89750@tar.com>; from Richard Seaman, Jr. on Tue, Apr 20, 1999 at 03:09:02PM -0500
References:  <199904201759.NAA15897@lor.watermarkgroup.com> <19990420111634.D10370@proxydev.inktomi.com> <19990420150902.A89750@tar.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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




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