Question

The project will consist of creating a simulation of an operating system scheduler handling multiple threads or processes. The student will create a program that launches 6 - 10 worker threads simulating a processor bound, I/O bound and an intermediate of the two types. The program will schedule the tasks using the First-Come, First-Served (FCFS), Shortest Job First, and Round Robin scheduling algorithms. The Program should be written in Java and the Round Robin algorithm should employ the suspend() and resume() thread methods.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

import java.util.*;

public class CPUBound {

    /**
    * @param args the command line arguments
    */

   
    public static void main(String[] args) throws InterruptedException {
       // TODO code application logic here
       HandlingQueue hq = new HandlingQueue();
       hq.start();
      
       //FCFS
       System.out.println("First come first served algorithm");
       System.out.println("Creating threads");
       hq.mode = 0;
       for (int i = 0; i < 6; i++)
       {
            ThreadClient threadClient = new ThreadClient();
            threadClient.ID = i;
            threadClient.executionTime = (6 - i) * 100000000;
            hq.WaitingQueue.add(threadClient);
            System.out.println("Thread " + i + " created.");
       }
       while (hq.mode != 3)
       {
            //System.out.println("mode = " + hq.mode);
            Thread.sleep(10);
       }...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Assisting Tutor

Related Homework Solutions

Windows OS Environment & Process Explorer Utility Assignment
Homework Solution
$75.00
Windows
OS
Process
Explorer
Task
Manager
CPU
Usage
History
Graph
Memory
I/O
Utilization
Thread
Process
State
Id
Priority
Scheduler
Parent
Child
CSwitch
Delta
Virtual
Size
Fault
Path
Image
Working
Set
Processes Behavior Under Windows OS Dealt by Task Manager
Homework Solution
$60.00
Process
Task Manager
Taskmgr.exe
Windows
Applications
Ctrl
Alt
Del
Esc
Status
Not Responding
Switch To
PID
CPU
Running
Tab
Memory
Priority
System
Idle
Real-Time
Performance
Usage
History
Commit Charge
Total
Limit
Peak
Kernel
C Shell Simulator
Homework Solution
$50.00
C
Computer
Science
Shell
Simulator
Background
Execution
Fork
Operating
Systems
Process
Child
Computer Science Questions
Homework Solution
$25.00
Computer Science
Gant Chart
Queue
FIFO
Tables
Rate Monotonic
Algorithms
Utilization
RMS
Graphs
Cycles
Deadlock State
Edges
Probes
Get help from a qualified tutor
Live Chats