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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Scheduling algorithms<br />

• Shortest-Job-First [preemptive or non-preemptive]<br />

◾ Given a set of processes, the process with the shortest next CPU burst is selected to execute on the CPU<br />

◾ Optimizes minimum average waiting time<br />

◾ There is an obvious problem with this – how do we know how long the next CPU burst will be for each<br />

process?<br />

◾ We can use past performance to predict future behaviour<br />

• Estimate the next CPU burst time as an exponential average of the lengths of previous CPU bursts<br />

• Let tn be the length of the n th CPU burst for a process and let τn+1 be our estimated next CPU burst time<br />

τn+1 = αtn+(1- α)τn , α ≤ 0 ≤ 1<br />

• If α = 0, the current prediction is equal to the last prediction<br />

• if α = 1, then τn+1 = αtn and the next CPU burst time is estimated to be the length of the last CPU burst time<br />

• We need to set τ0 to a constant value<br />

199<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!