Results 1 to 5 of 5
  1. #1
    santa's Avatar
    santa is offline Senior Member
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    208
    Rep Power
    5

    Default Javas built in monitor?

    So basically i'm practicing my java :P In the book it says that "Locks and conditions are more powerful and flexible than the built in monitor, and in consequence, this section of the book can be completely ignored. However if you are working with legacy java code, you may encounter Javas built in monitor"...

    So i'm a little confused... is the built in monitor referring to the Synchronized keyword or what? So basically when you use the Synchronized keyword you "lock it oldschool" and then you can use it as a monitor? Thanks

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: Javas built in monitor?

    Read the API doc for the notify and wait methods of the Object class for discussions of monitor.

  3. #3
    santa's Avatar
    santa is offline Senior Member
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    208
    Rep Power
    5

    Default Re: Javas built in monitor?

    My questions was in other words -does an object become a monitor when a thread locks it with synchronized? - Is it okay to use Synchronized or is that outdated to? Thanks

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: Javas built in monitor?

    Any object is a monitor for wait and notify and synchronized.
    The new classes give you a lot of new functionality with a small bit of extra usages to learn.

  5. #5
    santa's Avatar
    santa is offline Senior Member
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    208
    Rep Power
    5

Similar Threads

  1. JMF: capturing built in webcam
    By Perre in forum Advanced Java
    Replies: 0
    Last Post: 02-20-2010, 10:58 AM
  2. Using Applets built in GreenFoot?
    By sciguy77 in forum New To Java
    Replies: 0
    Last Post: 01-19-2009, 08:43 PM
  3. print without built functions
    By j2vdk in forum New To Java
    Replies: 19
    Last Post: 12-28-2008, 05:22 PM
  4. Netbeans built .jar for Mac
    By zobelogne in forum NetBeans
    Replies: 2
    Last Post: 11-03-2008, 04:54 PM
  5. Using the built-in enumeration methods
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-17-2008, 07:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •