What is context switching?

Answer Posted / santosh

The scheduler maintains a queue of executable threads for each priority level. These are known as ready threads. When a processor becomes available, the system performs a context switch. The steps in a context switch are:
Save the context of the thread that just finished executing.
Place the thread that just finished executing at the end of the queue for its priority.
Find the highest priority queue that contains ready threads.
Remove the thread at the head of the queue, load its context, and execute it.

Is This Answer Correct ?    14 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do we translate jsp?

770


What's the servlet interface?

818


Why is servlet used?

892


Once the destroy() method is called by the container, will the servlet be immediately destroyed? What happens to the tasks(threads) that the servlet might be executing at that time?

985


What is the dispatcher servlet?

719


How is the get () method different from the post() method?

726


Differentiate between get and post?

883


What is api in servlet?

743


How to get the current httpsession object?

865


Why is Servlet so popular?

778


How we can create war file in servlet?

842


How can we refresh automatically when new data is entered into the database?

815


How do cookies work in servlets?

786


Is it good idea to create servlet constructor?

982


Explain the working of service() method of a servlet.

693