Core Scheduling Program C

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Order a Similar Paper HERE Order a Different Paper HERE

Please use cin for input and cout for output. 

The input will be:

NCORES 1

START   0

PID     3

CORE   100

SSD   0

CORE   80

SSD   0

CORE   40

SSD   0

CORE   80

SSD   0

CORE   40

SSD   0

CORE 90

SSD 1

CORE  100

TTY 5000

CORE   20

TTY 5000

CORE   80

SSD   1

CORE   30

SSD   0

CORE 90

SSD   1

CORE   30

SSD   1

CORE   20

SSD   1

CORE   30

SSD   1

CORE   20

SSD   1

CORE   30

SSD   1

CORE   20

SSD   1

CORE   30

SSD   1

CORE   20

START  3

PID   5 

CORE 120

SSD 0

CORE 60

SSD 0

CORE 20

SSD 0

CORE 30

SSD   0

CORE   80

SSD   0

CORE   80

SSD   0

CORE   40

SSD   0

CORE   80

SSD   0

CORE   40

SSD   0

CORE 90

SSD   0

CORE   80

SSD   0

CORE   40

SSD   0

CORE 90

SSD 1

CORE  100

TTY 5000

CORE   80

SSD   0

CORE   80

SSD   0

CORE   40

SSD   0

CORE 90

SSD   1

CORE   30

SSD   1

CORE   20

SSD   1

CORE   30

SSD   1

CORE   20

SSD   1

CORE   30

SSD   1

CORE   20

START  5

PID   7 

CORE 120

SSD 0

CORE 60

SSD 0

CORE 20

SSD 0

CORE 30

START  8

PID     9

CORE   100

SSD   0

CORE   80

SSD   0

CORE   40

SSD   0

CORE  70

SSD   0

CORE   80

SSD   0

CORE   40

SSD   0

CORE 90

SSD   0

CORE   80

SSD   0

CORE   40

SSD   0

CORE 90

SSD   1

CORE   110

SSD   0

CORE   40

SSD   0

CORE 90

SSD 1

CORE  100

TTY 3000

CORE   120

TTY 2000

CORE   80

SSD   1

CORE   30

SSD   1

CORE   20

SSD   1

CORE   30

SSD   1

CORE   20

SSD   1

CORE   30

SSD   1

CORE   20

START  13

PID   11 

CORE 120

SSD 0

CORE 60

SSD 0

CORE 20

SSD 0

CORE 30

SSD   0

CORE   80

SSD 0

CORE 60

SSD 0

CORE 20

SSD 0

CORE 30

SSD   0

CORE   80

SSD   0

CORE   80

SSD   0

CORE   40

SSD   0

CORE   80

SSD   0

CORE   40

SSD   0

CORE 90

SSD   0

CORE   80

SSD   0

CORE   40

SSD   0

CORE 90

SSD 1

CORE  100

TTY 5000

CORE   80

SSD   0

CORE   80

SSD   0

CORE   40

SSD   0

CORE 90

SSD   1

CORE   30

SSD   1

CORE   20

SSD   1

CORE   30

SSD   0

CORE 90

SSD   1

CORE   30

SSD   1

CORE   20

SSD   1

CORE   30

SSD   1

CORE   20

SSD   1

CORE   30

SSD   1

CORE   20

END

The output will be:

— ARRIVAL event for process 3 at time 0 ms

Process 3 starts at time 0 ms

Process Table:

There are no active processes.

— ARRIVAL event for process 5 at time 3 ms

Process 5 starts at time 3 ms

Process Table:

Process 3 is RUNNING.

— ARRIVAL event for process 7 at time 5 ms

Process 7 starts at time 5 ms

Process Table:

Process 3 is RUNNING.

Process 5 is READY.

— ARRIVAL event for process 9 at time 8 ms

Process 9 starts at time 8 ms

Process Table:

Process 3 is RUNNING.

Process 5 is READY.

Process 7 is READY.

— ARRIVAL event for process 11 at time 13 ms

Process 11 starts at time 13 ms

Process Table:

Process 3 is RUNNING.

Process 5 is READY.

Process 7 is READY.

Process 9 is READY.

Process 7 terminates at time 1180 ms.

Process Table:

Process 3 is READY.

Process 5 is READY.

Process 7 is TERMINATED.

Process 9 is RUNNING.

Process 11 is READY.

Process 5 terminates at time 9250 ms.

Process Table:

Process 3 is BLOCKED.

Process 5 is TERMINATED.

Process 9 is RUNNING.

Process 11 is READY.

Process 9 terminates at time 9270 ms.

Process Table:

Process 3 is BLOCKED.

Process 9 is TERMINATED.

Process 11 is RUNNING.

Process 11 terminates at time 9689 ms.

Process Table:

Process 3 is BLOCKED.

Process 11 is TERMINATED.

Process 3 terminates at time 12359 ms.

Process Table:

Process 3 is TERMINATED.

SUMMARY:

Total elapsed time: 12359 ms

Number of processes that completed: 5

Total number of SSD accesses: 90

Average number of busy cores: 0.462821

SSD utilization: 0.00283194