Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why does it get stuck?  RSS feed

 
Yongping Wang
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just couldn't figure out why it gets stuck when running the following code:

Thanks for any comments.
Y.Wang
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens if the Calculator thread finishes before the readers get started? The notifyAll() notifies nothing, it is not queued. The readers will then wait for ever.
I think the authors of the book where this comes from have made a correction in the book's errata.

[ April 18, 2003: Message edited by: Barry Gaunt ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, which book are we talking about here?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!