This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Monitors  RSS feed

Betty Reynolds
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had always equated obtaining a lock on the object with maintaining its integrity with respect to its data, but given that the monitor gives up its lock when issuing the wait (I guess it has to--how else can the thread that issues the notify or notifyall execute) my question is: Are the variables defined by the object threadsafe at this point? That is, can they be modified by some thread in between the time the wait is issued and the notify takes place? Or is it a question of scope (i.e., just those inside the synchronized code are, etc.)
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!