Re: Accessing Physical Memory & Other Process's Address Space
- From: Tim Roberts <spamtrap@xxxxxxxxxx>
- Date: Thu, 14 Feb 2008 04:49:55 GMT
Gil Hamilton <spamtrap@xxxxxxxxxx> wrote:
Tim Roberts <spamtrap@xxxxxxxxxx> wrote:
Windows does have kernel-mode threads, but in Windows a "thread" and a
"process" are very different things. In Linux, the line between those
two concepts is rather fuzzy.
I don't really buy that. Would you explain what differences you see? As I
see it, while the mechanisms for creating processes and threads are
significantly different in the two systems, they share almost every
important conceptual attribute: The process represents those things that
can be shared among multiple threads: process ID, executable code, virtual
address space, open file descriptors, and so forth.
Well, perhaps my knowledge is out of date. The last time I looked into it,
threads in Linux were essentially implemented as a special case of
processes. That is, creating a thread basically did a lightweight process
creation.
The thread represents
an execution context and hence has a stack in user-mode representing its
context in user mode (and a kernel stack representing its context there).
In the traditional Unix concept, it is the process that has an execution
context and a stack, and my (possibly long outdated) understanding was that
threads simply inherited that.
Creating a process in linux with fork(2) simply creates a process with a
single unnamed thread implicitly attached to it.
Does it? Again, I thought each thread in the current Linux implementation
had its own process ID, so that creating a thread was not very much
different from a vfork(2).
I think it's slightly
more explicit in Windows -- IIRC, at the lowest level NtCreateThread must
be called to create the execution context before the process created by
NtCreateProcess can do anything -- but in the end, it's in the same thing.
In fact, ordinary programs just call CreateProcess, which creates both
process and thread. It's pretty much exactly equivalent to fork + exec.
I don't think that's an accurate assessment. In Windows, the process is
really just a container for memory and threads. A process is created and
assigned memory, and threads are created within it. In Linux, each thread
is essentially a mini-process.
Or so I thought.
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.
- Follow-Ups:
- Re: Accessing Physical Memory & Other Process's Address Space
- From: Gil Hamilton
- Re: Accessing Physical Memory & Other Process's Address Space
- References:
- Accessing Physical Memory & Other Process's Address Space
- From: mybwpp@xxxxxxxxxxxxxx
- Re: [Clax86list] Accessing Physical Memory & Other Process's Address Space
- From: Charles Crayne
- Re: Accessing Physical Memory & Other Process's Address Space
- From: mybwpp@xxxxxxxxxxxxxx
- Re: Accessing Physical Memory & Other Process's Address Space
- From: Tim Roberts
- Re: Accessing Physical Memory & Other Process's Address Space
- From: Gil Hamilton
- Re: Accessing Physical Memory & Other Process's Address Space
- From: Tim Roberts
- Re: Accessing Physical Memory & Other Process's Address Space
- From: Gil Hamilton
- Accessing Physical Memory & Other Process's Address Space
- Prev by Date: Re: GAS-Intel on Windows (MinGW)
- Next by Date: Get BIOS vendor/version/date and Machine serial/model?
- Previous by thread: Re: Accessing Physical Memory & Other Process's Address Space
- Next by thread: Re: Accessing Physical Memory & Other Process's Address Space
- Index(es):
Relevant Pages
|