Re: how this is done: process and thread have their own register set?



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.
.



Relevant Pages

  • Re: TI MSP430
    ... What is much more relevant is whether the register set and ... Are you mixing up position-independent code and relocatable code? ... the MAC programming conventions dedicated one processor register ... IIRC there were limits on the segment size of position-independent ...
    (comp.arch.embedded)
  • Re: TI MSP430
    ... What is much more relevant is whether the register set and ... target applications, or whether they would have been better off ... Are you mixing up position-independent code and relocatable code? ... the MAC programming conventions dedicated one processor register ...
    (comp.arch.embedded)
  • Re: heterogeneous register set?
    ... I don't understand what heterogeneous register set means. ... Sometimes, homogeneous register set is also called orthogonal, depending ...
    (comp.arch)
  • Re: heterogeneous register =?ISO-8859-1?Q?set=3F?=
    ... I don't understand what heterogeneous register set means. ... Sometimes, homogeneous register set is also called orthogonal, depending on the author. ...
    (comp.arch)
  • Re: Is Greenspun enough?
    ... no data pages can be executed unless some kind of EXECUTE ... Protected mode segment handling had performance issues vs. simple ... or to relocate it when moving it. ... >provide pc-relative branches (every branch was through a general register ...
    (comp.lang.lisp)