This week's book giveaway is in the Artificial Intelligence forum.
We're giving away four copies of Pragmatic AI and have Noah Gift on-line!
See this thread for details.
Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Class lock  RSS feed

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is class lock?
Do we need to know class lock for scpj 1.4 ?

Thank you,
Ambapali
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no idea what it is -- and I've read two SCPJ exam books -- so I'm gonna say no -- you don't need to know it (whatever it is)
 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

When synchMethod2 is called, the JVM will obtain a lock on the object my.
When synchMethod1 is called, the JVM will obtain a lock on the instance of java.lang.Class that represents MyClass, rather than obtaining a lock on a particular instance of MyClass.
For the exam it is probably enough to know that for a particular class, only 1 synchronized static method can be executing at a particular point in time, but many synchronized instance methods can run concurrently, as long as they are associated with different instances of that class.
[ January 13, 2003: Message edited by: John Paverd ]
 
Ambapali Pal
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Jhon.
 
Ambapali Pal
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry. John not Jhon
 
John Paverd
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ambapali Pal:
I am sorry. John not Jhon


Thats quite OK, Amabpali, oops I mean Ambapali

If you click on the little pencil and paper symbol above your post, you can correct it. I know this because I have to use this feature a lot on my own posts. In fact, you can see that I edited my first post in this topic.
You Can Call Me Al! - Paul Simon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!