Please send your comments, suggestions, errors, and bug reports to
shartley@mcs.drexel.edu Thanks.Delete question 3 from the distributed dining philosophers assignment on page 175. Deadlock is not possible if all forks are initially dirty and philosopher 1 has two.
On page 130 the implementation of signal and wait for signal-and-continue using semaphores is not correct. It should read
wait(condi):
COUNTi++
V(mutex)
P(SEMi)
P(mutex)
...
signal(condi):
if COUNTi > 0 then
COUNTi--
V(SEMi)
fi
V(mutex)
exit the monitor, i.e., return
A major oversight in the Acknowledgements is not thanking the team at the University of Arizona that developed SR: Greg Andrews, Ron Olsson, Gregg Townsend, and many graduate students. I am grateful to them for designing and implementing a very nice concurrent programming language that I have found extremely useful in my teaching.
There are some minor typographical errors in the text part of the book. These are readily identifiable.
Program 6.14, the driver for the lock example, has some statements
out of order in the do true loop in
process a_user.
The loop should be changed from
do true ->
napping := int(random(1000*nap_time))
write("age()=", age(), "user", i, "napping for", napping)
napping := int(random(1000*nap_time))
nap(napping)
write("age()=", age(), "user", i, "doing a down")
S.down()
write("age()=", age(), "after down, user", i, "napping for", napping)
napping := int(random(1000*nap_time))
nap(napping)
write("age()=", age(), "user", i, "doing an up")
S.up()
od
to
do true ->
napping := int(random(1000*nap_time))
write("age()=", age(), "user", i, "napping for", napping)
nap(napping)
write("age()=", age(), "user", i, "doing a down")
S.down()
napping := int(random(1000*nap_time))
write("age()=", age(), "after down, user", i, "napping for", napping)
nap(napping)
write("age()=", age(), "user", i, "doing an up")
S.up()
od
Here is the complete fixed
program
with a new example run.
Some minor changes have been made to the following programs:
see_if_very_hunger to
see_if_very_hungry;
mentioned nested _proc() causes deadlock in a comment
# style comments to /* */
as per the manual page for m2sr
max := n*n and changed fa loop
to do (still by 2)
The global resource SRanimator, Program 7.15, is an earlier
version of the one distributed in version 2.3 (October 1994)
of the SR software.
Several new animation actions are supported.
op A_fonttext(id : int; lx, ly : real; cen : int; colorr, fontname, str : string[*]) op A_stepjump(id : int; tx, ty : real; nsteps, steptime : int) op A_stepjumpto(id1, id2 : int; nsteps, steptime : int) op A_resize(id : int; rx, ry: real) op A_zoom(id : int; rx, ry: real) op jumpsteps(id : int; tx, ty : real; nsteps, steptime : int) op jumptosteps(id1, id2 : int; nsteps, steptime : int)And two new parameters,
style and arrows,
were added to the line drawing procedure.
op A_line (id : int; lx, ly, sx, sy : real; colorr, width, style, arrows : string[*])For more details, see the paper
sranimator.ps in the
doc directory of the SR distribution.
In the Instructor's Manual, ``See Section 7.5.3 for a similar experiment using quicksort.'' should read ``See the Parallel Computing section on page 79....''
SJH shartley@mcs.drexel.edu