Professional Documents
Culture Documents
CPS 305 Fountain Assignments
CPS 305 Fountain Assignments
P1
P2
P3
P4
P5
P1
P5
P1
P5
P1
P1
P1
0
2
3
5
7
9
11
13
14
16
18
19
(b) Waiting
time
for
each
of
the
scheduling
algorithm
a. FCFS
(0+10+11+13+14)/5
=
48/5
milliseconds
b. SJF
(9+0+2+1+4)/5
=16/5
milliseconds
c. Priority
(6+0+16+18=1)/5
=31/5
milliseconds
d. Round
Robin
(0+2+3+5+9+11+13+14+16+18)/5
=91/5
millisecs
(c) Average
waiting
time
will
be
Shortest
Job
First
(SJF)
algorithm
with
an
average
waiting
time
of
16/5
milliseconds
2.
Interprocess
Communication
In
certain
instances
processes
that
run
together
may
need
to
communicate
by
exchanging
code
and
data,
they
can
also
affect
each
other.
For
processes
that
do
not
need
to
exchange
code
or
data,
and
do
not
care
to
know
about
the
existence
of
each
other,
they
are
independent
process.
The
processes
that
needs
to
exchange
code
and
data
and
can
also
be
affected
by
the
status
of
each
other
are
called
cooperating
process.
For
cooperating
process,
there
are
two
modes
of
cooperation
which
are
message
passing
and
shared
memory.
For
message
passing,
each
process
will
have
the
capability
to
exchange
messages
with
one
another,
important
and
status
messages.
For
shared
memory,
a
shared
memory
region
is
created
which
is
known
to
all
the
cooperating
process.
They
can
access
and
drop
any
important
or
status
messages
and
can
also
request
for
messages