DragonFly BSD
DragonFly kernel List (threaded) for 2005-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: LWPs and LWKTs, how they relate

From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Thu, 6 Oct 2005 00:36:13 +0200

On 06.10.2005, at 00:14, Alex Burke wrote:
Firstly, I hope this email is in the correct format.... I am sending from gmail, and have disabled the rich text formatting stuff.

Unfortunately something in the mailway still fucks up the base64-encoded mails from gmail...

I was just wondering, what will be the interaction between LWPs (I saw a commit message indicating we will be implementing these) and LWKTs.

Each LWP has exactly one LWKT associated. This is the 1:1 part of the threading. Of course there still will be LWKTs that don't have any LWP associated (kernel threads).

Also, in the conext of DragonFlyBSD after this change... what will a "process" entity actually be?

The process entity will still be "struct proc". This represents the process, i.e. vmspace, credentials, open files, alarm timers, signal actions (not masks), and stuff like that.

I notice in a commit mesasage that a mapping of one LWP to one process is currently enforced, will this change?

Yes. As soon as the kernel is fully aware of lwps and uses them to actually access thread-local data (sigmask, accounting statistics) we can remove the embedded lwp and allocate a new lwp every time a process spawns a new thread.

What distinguishes a classic process from a LWP? (reading'moden operating systems', i thought a process was something that had executable conext, possibly multiple (i.e. a threaded program), but included all associated file descriptors etc... not sure what this new subdivision does).

That's exactly the division. A process (struct proc) has a vmspace, file descriptors, etc. Each thread within a process (struct lwp) carries that data neccessary for its execution (signal mask and attached lwkt being one of the most important things).

So it is:

proc 1 <-> lwp 1 <-> lwkt 1 [single threaded]

proc 2 <-> lwp 2 <-> lwkt 2  [multi threaded]
        \> lwp 3 <-> lwkt 3

lwkt 4 [kernel thread]

One proc groups multiple "threads" called struct lwp.

Hope this question does not seem too stupid.

Not at all! I will come up with a roadmap in some minutes.


Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low $$$ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \

Attachment: PGP.sig
Description: This is a digitally signed message part

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]