Question: for an operating systems project using java, how can i implement the following: When a job arrives, one of three things may happen: 1 .

for an operating systems project using java, how can i implement the following: When a job arrives, one of three things may happen:
1. If there is not enough total main memory or total number of devices in the system for the job, the job
is rejected never gets to one of the Hold Queues.
2. If there is not enough available main memory or available devices for the job, the job is put in one of
the Hold Queues, based on its priority, to wait for enough available main memory (Preallocation).
3. If there is enough main memory and devices for the job, then a process is created for the job, the required
main memory and devices are allocated to the process, and the process is put in the Ready Queue.
When a job terminates, the job releases any main memory. The release of main memory may cause one
or more jobs to leave one of the Hold Queues and move to the Ready Queue.
Assume that all the two Hold Queues are based on priority. There are two external priorities: 1, and 2
with 1 being the highest priority. Priority is only used to put processes in Hold Queues (Hold Queue1-
>Priority 1 and Hold Queue2>Priority 1) :
Job scheduling for Hold Queue 1 is Based on the Requested Units of Main Memory (Ascending
Order).
Job scheduling for Hold Queues 2 is First In First Out (FIFO).
Process scheduling will be Dynamic Round Robin. The operating system adjusts the time quantum
according to the burst time of the existed set of processes in the ready queue. For the first process, it
begins with time quantum equals to the burst time of first process, which is subject to change after the end
of the first time quantum. Repeatedly, when a new process is loaded into the ready queue in order to be
executed, the operating system calculates the average of sum of the burst times of processes found in the ready queue including the new arrival process. This method needs two global variables:
- SR: to store the sum of the remaining burst times in the ready queue.
- AR: to store the average of the burst times by dividing the value found in the SR by the count of processes found in the ready queue. 3. The system turnaround time only at the last display. Assume that the input file has a "D " command
at the end, so that you dump the final state of the system. is to be taken as a large number (i.e. the very
last event of the input file and subsequently of the system. Infinity will be denoted by 999999.Helpful Hints
Let i denote the time on the next input command, if there is still unread input: otherwise, i is infinity. Let
e denote the time of the next internal event, which will be the time at which the currently running job
terminates or experiences a time quantum expiration. The "inner loop" of your program should calculate
the time of the next event, which is the minimum of the i and e. If i=e, then process the internal event
before the external event (input file event). Notice that if this is not strictly followed, your results will not
match the expected output to grade your project!
Your simulation must have a variable to denote the "current time". This variable must always be advanced
to the time of the next event by a single assignment. (The variable cannot be "stepped" by a fixed
increment until it reached the time of the next event.).
Implementation Hints
Implement the Hold Queues as sorted linked lists.
Implement the process table as an array of size 100; the D command dumps the process table. (Do not
confuse this table with the PCB's.)
The end of a time slice is an internal event. You may assume a context switch will take zero time.
Other Hints:
When a job completes, it releases main memory and implicitly releases the devices. Thus, check the
Hold Queue 1 before the Hold Queue 2.
The only constraints to move from one of the Hold Queues to the Ready Queue are main memory
and devices.
If more resources are needed than the system contains (NOT available, Actually contains) then
do not even consider the jobs. (Kick it out and do not "count" the job).
If jobs have same Requested Units of Main_Memorv and same priority, use FIFO scheduling.
Handle all internal events before external.
Do not use an array of size 100 for jobs.
A display event is external.
There will never be two external events at the same time.
Absolutely under no circumstances do you want to read the entire input file in the beginning of the program (i.e. pre-process the input file).
for an operating systems project using java, how

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!