multithreading - How does a computer use just a few registers? -
I have a bit of information about the assembly, and that 4 or 8 are general purpose registers in all the computer programs Work with that amount of registers, especially with multithreading and everything?
Multi-threading does not affect the number of registers in use. When a thread is swapped, its registers are usually saved in memory and those registers are loaded with their previous save to run the next thread.
Example System TCB with a thread control block structure). In this structure (when thread was not running), saved instruction pointer, stack pointer, general purpose registers, floating point registers, thread data and so on. In essence, it is necessary to completely restore the thread in that position when it used to run another thread.
And whatever goes on in the computer, this is not done in the registers. Modern compiler can optimize the code so that the data items used in the data are kept in the registers, but most of the data is stored in the memory and only when the need is made is bought in the registers only.
The best book I've ever read is on the subject which examines the computer from the digital logic level to the level of the operating system, with each level building at the previous level, in the context of the layers.
& nbsp; & Nbsp; & Nbsp; & Nbsp; & Nbsp;
On one side: My dream one day writes a book, the way everything , from quark level to amex: -)
Comments
Post a Comment