I'm a bit stuck at this question. From what I found the:
- TT = Burst - waiting or exit-arrival
- RT = start time - arrival
In the book there is an example:
P1 P2 P3
arr 0 0 0
comp. 10 10 10
I wrote function and got:
- For fifo I found that TT is : 10 ,20 ,30
- RT : 0 , 10 ,20
But I'm struggeling to find TT and RT for the same process but for RoundRobin (with some quantum). Answer from a book is:
- TT: 28, 29, 30
- RT: 0, 1, 2 How was it calculated? Need help with defining how to find TT and RT for RR. With example and calc. please.
Update:
I managed to find a RT for a rr and fifo:
Rt1 = 0 -0 = 0 quantum = 1 : 0-0 = 0
Rt2 = 10-0 = 10 quantum = 1 : 1-0 = 1
Rt3 = 20-0 = 20 quantum = 1 : 2-0 = 2
But still not getting correct TT.
func (j Job) TurnaroundTime() time.Duration {
Tt := (j.finished - j.arrival - j.estimated) + j.estimated
return Tt
}
func (j Job) ResponseTime() time.Duration {
if j.id == 1 {
Rt = time.Duration(0)
}
Rt := j.start - j.arrival
//fmt.Print(Rt, j.start, j.Now(), " - ")
return Rt
}