Re: Waiting For A Synchronized Method

From: Chris Uppal (chris.uppal_at_metagnostic.REMOVE-THIS.org)
Date: 08/23/04

  • Next message: Christian \: "performance problem with JMS"
    Date: Mon, 23 Aug 2004 13:07:17 +0100
    
    

    cppaddict wrote:

    > Say thread1 begins executing a synchronized method.
    >
    > While it's executing, both thread2 and thread3 call the synchronized
    > method, in that order.
    >
    > When thread1 ends executing and gives up its lock, is thread2
    > guaranteed to execute next

    No.

    > or is it possible that thread3 executes first?

    Yes. Or rather, it is implementation-dependent, so don't assume anything.

        -- chris


  • Next message: Christian \: "performance problem with JMS"