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

Object monitor information stored where in case of threads  RSS feed

 
Rajdeep Biswas
Ranch Hand
Posts: 224
1
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its pertinent that in case of threads working on some instance methods, it acquires the monitor or lock of that object and then goes in to operate.
I am thinking that there might be some kind of registry with this instance information and some flag in there that says whether its acquired or not.
I was just wandering where this information is stored and how is it shared between threads. It'll be great to know in case someone sheds some light on this.
 
Henry Wong
author
Sheriff
Posts: 22840
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This, of course, is an implementation detail of the JVM, and may vary from OS to OS, and from version to version. Having said that, since most of the thread stuff has been delegated to the underlying Operating System threading environment, it would be safe to assume that every object has access to a mutex lock and condition variable.

Henry
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!