Re: how this is done: process and thread have their own register set?
- From: Tim Roberts <timr@xxxxxxxxx>
- Date: Wed, 19 Sep 2007 06:39:50 GMT
linq936 <linq936@xxxxxxxxx> wrote:
I come across this question: each process and thread has its own
register set, at least program counter register. But one processor has
only one PC register, right? If this is the case, then how can
multiple processes have their own PC register?
Do they have to swap out? But how about thread?
Expanding just a bit on Josef's answer, in Windows, threads are the things
that execute, so each thread has a register set. A process contains the
memory space and a collection of threads, but it doesn't execute on its
own.
Remember that your computer is very, very fast, but a single CPU can only
execute one thing at a time. About 100 times a second, the system gets
interrupted by the timer, where the current registers get saved. The
system then decides which thread gets to execute next, and it sets things
up so that the registers for that thread get loaded into the CPU.
It LOOKS like all of the threads are running at once.
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.
- References:
- Prev by Date: Re: how this is done: process and thread have their own register set?
- Next by Date: Re: What exactly is the need to have swappable and non swappable pages
- Previous by thread: Re: how this is done: process and thread have their own register set?
- Next by thread: Exclusive control
- Index(es):
Relevant Pages
|
|