Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

I need to create a method in java called do_create(TaskCB task) that is part of public class ThreadCB. The purpose of this method is to create a thread. First it needs to check if a task is null, if yes then it will call the dispatcher located in do_dispatch() and return null. Then it needs to check if the thread already has the maximum number of threads (MaxThreadsPerTask), use task.getThreadCount(). If yes then call the dispatcher and return null, if no then create the thread. Set up the thread priority and status using setPriority() of thread and getPriority() of task. Set up status SetStatus() to ThreadReady. Associate the task with the thread setTask(task). Associate teh thread with the task addThread(thread). If this fails call dispatcher and return null. Append new thread to readyqueue. Call dispatcher and return thread.

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

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

More Books

Students also viewed these Databases questions