Results 1 to 5 of 5
  1. #1
    sumanandjesus is offline Member
    Join Date
    Mar 2009
    Posts
    4
    Rep Power
    0

    Arrow how to synchronize a thread

    hi
    actually iam new to java and iam in learning stage can anyhow help me that how to synchronize a thread plz help me with great heart

  2. #2
    sumanandjesus is offline Member
    Join Date
    Mar 2009
    Posts
    4
    Rep Power
    0

    Default

    plz help me in synchronizing a thread

  3. #3
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    7

  4. #4
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    Can you be more specific? Obviously, the "synchronized and synchronize()" structures are used to synchronize.

  5. #5
    serjant's Avatar
    serjant is offline Senior Member
    Join Date
    Jun 2008
    Location
    Ukraine,Zaporozhye
    Posts
    487
    Rep Power
    7

    Default

    When u use two threads in one method, usually U declare the method as :
    Java Code:
    public synchronized void syncThreads(){
    
    }
    Or there is another way, by locking and unlocking threads . Or Condition.

Similar Threads

  1. Difference between Thread.yield() and Thread.sleep() methods
    By Nageswara Rao Mothukuri in forum New To Java
    Replies: 12
    Last Post: 07-30-2010, 06:37 PM
  2. Replies: 0
    Last Post: 04-09-2008, 07:39 PM
  3. How to synchronize threads on an object
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-09-2008, 07:39 PM
  4. Can't synchronize multiple JPanels in a JFrame
    By vassil_zorev in forum AWT / Swing
    Replies: 0
    Last Post: 12-30-2007, 05:22 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
  •