Skip to content

Commit

Permalink
Add entry for page 180 to errata.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
mwand authored Apr 3, 2020
1 parent aab14ab commit b50e015
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions errata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ Section 4.4:
Line 5:
newpair ==> make-pair

Page 180:
205 is printed by the producer. So the text should say:

So the first two items, 300 and 205, are printed by the main thread and the subthread respectively.

Page 195:
Figure 6.1, in apply-cont, the case for fact1-cont:
(begin
Expand Down

2 comments on commit b50e015

@mwand
Copy link
Owner Author

@mwand mwand commented on b50e015 Sep 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, what's the issue here?

@chihyang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the issue #24 (comment) said:

The third line from the end of page 180 says:

So the first two items, 300 and 205, are printed by the main thread.

But according to the program on page 181:

let buffer = 0
       in let producer = proc (n)
              letrec
                wait4(k) = if zero?(k)
                           then set buffer = n
                           else begin
                                  print(-(k,-200));
                                  (wait4 -(k,1))
                                end
                in (wait4 5)
          in let consumer = proc (d)
                  letrec busywait(k) = if zero?(buffer)
                                       then begin
                                             print(-(k,-100));
                                             (busywait -(k,-1))
                                            end
                                       else buffer
                  in (busywait 0)
              in begin
                  spawn(proc (d) (producer 44));
                  print(300);
                  (consumer 86)
                 end

205 is printed by subthread. So the text on page 180 might be:

So the first two items, 300 and 205, are printed by the main thread and the subthread respectively.

Text and code are not consistent with each other.

Please sign in to comment.