Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to create a method called do_dispatch() in java that is part of public class ThreadCB. The purpose of this method is to select

I need to create a method called do_dispatch() in java that is part of public class ThreadCB. The purpose of this method is to select a thread to dispatch. The method must check if there is currently a thread running, and if there is it must let its task know that it is not the current thread by invoking setCurrentThread(null). It also must take away cpu control by setting PTBR to null using setPTBR(null), set the threads stats to ThreadReady, and place it in the ready queue. It must select the thread at the head of the ready queue and if that is empty then set the PTBR to null and return failure. o/w set the PTBR to point to the threads page table. Set the thread as the current thread of its task using setCurrentThread(thread). Set the threads status to ThreadRunning. Set the interrupt timer using a quantum of 50. Then return SUCCESS.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Transaction Processing

Authors: Philip M. Lewis, Arthur Bernstein, Michael Kifer

1st Edition

0201708728, 978-0201708721

Students also viewed these Databases questions