1,163 views

2 Answers

1 votes
1 votes

Answer:

The register set is listed as a per-thread rather than a per-process because of the following reasons:

  • Multiprogramming threads behave in the same way as the multiprogramming processes. Due to this each thread require its own area for saving the register.
  • When a thread stops, the register has the values of the threads which is needed to be saved, just like when the process halts then the register must be saved.

 

0 votes
0 votes
Registers store the thread data that the cpu was working with. If a thread wants to start right where it was context switched earlier, it needs that temporary data also. Hence we store it on per thread basis.

Else, if we are okay with repeating the most recent instruction, then a PC register will suffice and rest registers we can remove.

Related questions

0 votes
0 votes
1 answer
1
admin asked Oct 24, 2019
596 views
In a system with threads, is there one stack per thread or one stack per process when user-level threads are used? What about when kernel-level threads are used? Explain....
0 votes
0 votes
0 answers
3
admin asked Oct 24, 2019
278 views
Can the priority inversion problem discussed in Sec. $2.3.4$ happen with user-level threads? Why or why not?
0 votes
0 votes
0 answers
4
admin asked Oct 24, 2019
1,668 views
Does Peterson’s solution to the mutual-exclusion problem shown in Fig. $2-24$ work when process scheduling is preemptive? How about when it is nonpreemptive?