in Operating System
1,731 views
0 votes
0 votes
A simplified view of thread states is Ready, Running, andBlocked, where a thread is either ready andwaiting to be scheduled, is running on the processor, or is blocked (for example, waiting for I/O). Assuming a thread is in the Running state, answer the following questions, and explain your answer:

 a. Will the thread change state if it incurs a page fault? If so, to what state will it change?

b. Will the thread change state if it generates a TLB miss that is resolved in the page table? If so, to what state will it change?

c. Will the thread change state if an address reference is resolved in the page table? If so, to what state will it change?

I know, for part a, the thread will change its state from running to waiting.

 

However, I am highly confused over answers to part b, and part c.
in Operating System
1.7k views

2 Comments

b. Since the reference is resolved in Page Table, so there is no need for waiting for anything. So it will continue to run.

c. Same is the case here

0
0
Yeah.. No need to go to waiting state... But can it move from Running to Ready state....??
0
0

1 Answer

1 vote
1 vote
a) The thread will change it's state from running to blocked since there is a page fault and page fault requires I/O operation from disk

b) The thread will change it's state from running to waiting(ready), so that in the meantime(time to access page table) another thread could be scheduled.

c) Assuming there is no TLB, thread will not change it's state.

2 Comments

Why do you think you are right about B, that thread will change it's state to waiting (ready) ?

Think about your answer after reading below

Where do you think is the page table ?

a. In the OS specific memory ?

b. Or in the process own memory ?

Every process has it own page table, so it is in the process own memory. So, process would access page table in its own memory. Now, why would process have to wait to access its own memory ?

0
0
Yes, process has its own memory but there may be many treads inside a process and here, in this question we are talking about threads (not process).

i) thread switching time is very less(within process) compared to process.

ii) memory access time is very much compared to thread switching time.

so, in the meantime of memory access, thread switching will take place.
0
0

Related questions