1 Reply Latest reply: Sep 22, 2007 12:03 AM by 800308 RSS

    Thread,Variable,

    807600
      Hello!

      Say we have a class A,It has two threads ,They want to modify one variable(int i).How JAVA locks this variable for threads? ( Something like mutexin order to prevent bad modify)May show this by coding?Thanks
        • 1. Re: Thread,Variable,
          800308
          Simo,
          How Java locks this variable for threads?
          Java doesn't lock anything... but it does give you (the programmer) the tools to do so...

          Start here: http://java.sun.com/docs/books/tutorial/essential/concurrency/

          keith.