Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 May 2002 10:36:47 +0800
From:      "kai ouyang" <oykai@msn.com>
To:        "Julian Elischer" <julian@elischer.org>, <current@FreeBSD.org>, <oyk@wtwh.com.cn>
Subject:   Re:why change: from proc to thread?
Message-ID:  <OE160GIpGPnLajJwb1S00006520@hotmail.com>

next in thread | raw e-mail | index | archive | help

------=_NextPart_001_0001_01C206FC.BC42E0E0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: quoted-printable


Thank you! I know a little more.
From the kthread_create() function, I find Both 4.x and 5.0 are implement=
ed by fork1().
I am puzzled about the structure thread and the structure proc only are d=
ifferent terms.
How or what part source code can I find the difference thread realization=
 between 4.x and 5.0?

On Mon, 27 May 2002, kai ouyang wrote:

> Hi,everybody
>   I found many v_operations, such as VOP_UNLOCK, VOP_OPEN....., there
> all have a parameter(struct proc) in FreeBSD4.x, but, there all be
> changed to thread in FreeBSD5.0. why? And what relation of the proc
> and thread ?
>   Thank you!
>

FreeBSD is plannig on supporting threads at a kernel level.
To do this, the basic scheduling element becomes the thread instead of th=
e
process. For this reason, for example, locks must be held by threads
instead of processes, and contexts are owned by threads instead of
processes. This means that most functions will need a thread pointer
instead of a process pointer. The "process" becomes basically an
accounting abstraction and the holder of resources, where most of the
kernel is more interested in the thread.

Each process has at least one thread, possibly many. Each thread is
associated with exactly one process.



julian=B4=D3=CD=F8=D5=BE=B5=C3=B5=BD=B8=FC=B6=E0=D0=C5=CF=A2=A1=A3MSN Exp=
lorer =C3=E2=B7=D1=CF=C2=D4=D8:http://explorer.msn.com/lccn

------=_NextPart_001_0001_01C206FC.BC42E0E0
Content-Type: text/html; charset="gb2312"
Content-Transfer-Encoding: quoted-printable

<HTML><BODY STYLE=3D"font:10pt verdana; border:none;"><DIV>&nbsp;</DIV> <=
DIV>Thank you! I know a little more.</DIV> <DIV>From the kthread_create()=
 function, I find Both 4.x and 5.0 are implemented by fork1().</DIV> <DIV=
>I am puzzled about the structure thread and the structure proc only are =
different terms.</DIV> <DIV>How or what part source code can I find the d=
ifference thread realization between 4.x and 5.0?</DIV> <BLOCKQUOTE style=
=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT:=
 #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV><BR>On Mon, 27 May 2002, kai=
 ouyang wrote:<BR><BR>&gt; Hi,everybody<BR>&gt;&nbsp;&nbsp; I found many =
v_operations, such as VOP_UNLOCK, VOP_OPEN....., there<BR>&gt; all have a=
 parameter(struct proc) in FreeBSD4.x, but, there all be<BR>&gt; changed =
to thread in FreeBSD5.0. why? And what relation of the proc<BR>&gt; and t=
hread ?<BR>&gt;&nbsp;&nbsp; Thank you!<BR>&gt;<BR><BR>FreeBSD is plannig =
on supporting threads at a kernel level.<BR>To do this, the basic schedul=
ing element becomes the thread instead of the<BR>process. For this reason=
, for example, locks must be held by threads<BR>instead of processes, and=
 contexts are owned by threads instead of<BR>processes. This means that m=
ost functions will need a thread pointer<BR>instead of a process pointer.=
 The "process" becomes basically an<BR>accounting abstraction and the hol=
der of resources, where most of the<BR>kernel is more interested in the t=
hread.<BR><BR>Each process has at least one thread, possibly many. Each t=
hread is<BR>associated with exactly one process.<BR><BR><BR><BR>julian<BR=
><BR><BR></DIV></BLOCKQUOTE></BODY></HTML><br clear=3Dall><hr>=B4=D3=CD=F8=
=D5=BE=B5=C3=B5=BD=B8=FC=B6=E0=D0=C5=CF=A2=A1=A3MSN Explorer =C3=E2=B7=D1=
=CF=C2=D4=D8=A3=BA<a href=3D'http://explorer.msn.com/lccn'>http://explore=
r.msn.com/lccn</a><br></p>

------=_NextPart_001_0001_01C206FC.BC42E0E0--

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




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