Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
same time. They have estimated running times of 10, 6, 2, 4 and 8 minutes.
Their (externally determined) priorities are 3, 5, 2, 1 and 4,
respectively, with 5 being the highest priority. For each of the following
scheduling algorithms, determine the mean process turnaround time. Ignore
process switching overhead. All jobs are CPU bound.
(a)Round Robin. Preemptive multiprogramming. Each job gets its fair share
of CPU.
Initially all five processes are running, so they each get 1/5 of the CPU,
which means they take 5 times longer to run. This means that it will take
10 mins for C (the shortest job) to complete.
After 10 mins each job
have 8 mins left, B 4,
they will each get 1/4
as long to run. So, it
+ 8 = 18 mins).
*****************************************************************************
4.(Tao) A fast food restaurant has four kinds of employees: (1) order takers, who take
orders (2) cooks, who prepare the food (3) packaging specialists, who stuff the food
into bags; and (4) cashiers, who gives the bags and collect money from customers.
Each employee can be regarded as communicating sequential process. What form of
interprocess communication do they use? Relate this model to processes in UNIX.
Both direct communication(send(P,message),receive(id,message)) and indiect
communication(send(A,message),receive(A,message)) can be used in the interprocess
communication. Related UNIX processes(system calls):
simplest communication: using pipes
direct communication related system calls: msgget(), msgctl(),msgsnd() and
msgrcv();
indirect commnunication related system calls: shmget();shmat();shmdt();shmctl();
Semorphore related: semget();semctl();semop()
********************************************************************