I need a solution to this problem, can anyone help? CSC 4663: Operating Systems
ID: 3708140 • Letter: I
Question
I need a solution to this problem, can anyone help?
CSC 4663: Operating Systems Programming Assignment Management of Processes and Resources 1. Assignment Overview In this assignment, you will examine the portion of the kernel that addresses the management of processes and resources. You will develop a system that will allow us to create the data structures to represent processes and resources. We will also implement the operations invoked by processes to manipulate other processes or to request/release various resources. The manager will be tested using presentation shell developed as part of the assignment. This will allow you to test the manager without running the actual processes. Instead, the presentation shell will play the role of both the currently running process; it will accept commands typed in by the user, and will invoke the corresponding function of the manager 2 BASIC PROCESS AND RESOURCE MANAGER 2.1 Process States We assume there are only three process states: ready, running. blocked. The following table lists the possible operations a process may perform and the resulting state transitions Operation old state new state Create Request Relcase Destroy (none) -> ready Running-blocked Blockedready Any-> (none) Scheduler Ready -> running Running --> ready All of the above operations except the Scheduler are invoked directly by the currently running process-the end of cach of the operations. hey represent kernel calls. Thc Scheduler is a function that is invoked automatically at the 2.2 Representation of Processes Each process is represented by a data structure called the process control block (PCB. For this project, we use the following fields of the PCB ID Memo Other Resources Status Creation Tree rio .ID is a unique process identifier by which the process may be referred to by other processes.Explanation / Answer
import java.awt.*;
import java.awt.event.*;
import java.util.concurrent.ExecutionException;
import javax.swing.*;
public class
SwingWorkerCounter extends JPanel
{
//For counter
private JTextField tfCount;
private int count = 0;
//for SwingWorker
JButton btnStartWorker;
//to start the worker
private JLabel lblWorker;
//for displayong result
/*Constructor to setup the GUI components*/
public SwingWorkerCounter()
{
setlayout(new FlowLayout());
add(new JLabel("Counter"));
tfCount = new JTextField("0",10);
tfCount.setEditable(false);
add(tfCount);
JButton btnCount = new JButton("Count");
add(btnCount);
btnCount,addActionListener(new action listener)
{
@Override
public void action performed(ActionEvent e)
{
++count;
tfCount.setText(count+"");
}
});
protected String doinBackground() throws Exception
{
long sum=0
for(int nmber=1; number<1000000000;++number)
{
sum+=number;
}
return sum+"";
}
protected void done()
{
String result=get();
ibiWorker.setText("Result is" +result);
}
catch(InterruptedException e)
{
e.printStackTrace();
}
catch
(ExcutionException e){
e.printStacktrace();
}
}
};
btnStartWorker=new JButton("Start Worker");
add(btnStartWorker);
btnStartWorker.addActionListener(new ActionListener()
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.