mugle-dev team mailing list archive
-
mugle-dev team
-
Mailing list archive
-
Message #00060
Re: Static methods with 'synchronized'
Hi Matt,
May be you are correct. I've used synchronized when working with threads and
i *thought* synchronized also makes the statements wait for a call to return
within that method.
For example, if a query was made, I'd want it to wait till there's a
feedback from the query without using a callback.
But this don't seem to be the correct way to do it.
Prageeth
On Wed, Mar 9, 2011 at 4:03 PM, Matt Giuca <matt.giuca@xxxxxxxxx> wrote:
> Hi Prageeth,
>
> You added the 'synchronized' keyword to a bunch of static methods (e.g., in
> data-wrapper r57<http://bazaar.launchpad.net/%7Emugle-dev/mugle/data-wrapper/revision/57>).
> I'm just wondering what the purpose of this was.
>
> I haven't ever used this keyword before, so forgive me if I misunderstood
> something. I just read the documentation earlier. It seems that if you add
> it to a static method, it will lock the class whenever any synchronized
> static method is called, which means it is not possible for any two threads
> to be executing any code in any synchronized static method at the same time.
> That doesn't seem necessary given that the class has no static data. Is
> there a reason for doing this?
>
> Matt
>
> --
> Mailing list: https://launchpad.net/~mugle-dev
> Post to : mugle-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~mugle-dev
> More help : https://help.launchpad.net/ListHelp
>
>
--
*Prageeth Silva*
Follow ups
References