Re: Waiting For A Synchronized Method
From: Chris Uppal (chris.uppal_at_metagnostic.REMOVE-THIS.org)
Date: 08/23/04
- Previous message: Chris Uppal: "Re: Hashtable efficiency"
- In reply to: cppaddict: "Waiting For A Synchronized Method"
- Next in thread: Frank: "Re: Waiting For A Synchronized Method"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: Chris Uppal: "Re: Hashtable efficiency"
- In reply to: cppaddict: "Waiting For A Synchronized Method"
- Next in thread: Frank: "Re: Waiting For A Synchronized Method"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]