01.06.2014 Views

Concurrent Systems II - Bad Request - Trinity College Dublin

Concurrent Systems II - Bad Request - Trinity College Dublin

Concurrent Systems II - Bad Request - Trinity College Dublin

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Scheduling algorithms<br />

• First-Come First-Served (FCFS) [non-preemptive]<br />

◾ The process that requests the CPU first is the first to be scheduled<br />

◾ Implemented with a FIFO ready queue<br />

◾ When a process enters the ready state, it is placed at the tail of the FIFO ready queue<br />

◾ When the CPU is free and another process must be dispatched to run, the process at the head of the queue is<br />

dispatched and the running process is removed from the queue<br />

◾ The average waiting time under FCFS scheduling can be quite long and depends on the CPU burst times of the<br />

processes<br />

◾ Consider three processes: P1, P2 and P3 that appear on the FCFS ready queue in the order P1, P2 and P3 and<br />

with burst times of 24, 3 and 3 milliseconds respectively<br />

P 1 P 2 P 3<br />

0 24 27<br />

◾ Average waiting time = (0 + 24 + 27) / 3 = 17 ms<br />

197<br />

<strong>Trinity</strong> <strong>College</strong> <strong>Dublin</strong><br />

© Mike Brady 2007–2009

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!