Skip to main content



      Home
Home » Eclipse Projects » JFace » ChangeManager#getRealm thread safety concern
ChangeManager#getRealm thread safety concern [message #20519] Sun, 12 July 2009 22:09 Go to next message
Eclipse UserFriend
In ChangeManager (the root of many observables like WritableList), the
"realm" field is not final and getRealm() has no synchronization. My basic
and limited understanding of the Java Memory Model tells me that I have a
chance of getting null from getRealm if I access it from a different thread
than the one that created the object.

Can anyone confirm or refute this? I think making the realm field final
would be good practice regardless.

-Will
Re: ChangeManager#getRealm thread safety concern [message #20553 is a reply to message #20519] Mon, 13 July 2009 12:13 Go to previous message
Eclipse UserFriend
See bug 282690. The plan is to synchronize isDisposed() and to no
longer null the realm. We could probably make it final too as you have
suggested.

Matthew

Will Horn wrote:
> In ChangeManager (the root of many observables like WritableList), the
> "realm" field is not final and getRealm() has no synchronization. My
> basic and limited understanding of the Java Memory Model tells me that I
> have a chance of getting null from getRealm if I access it from a
> different thread than the one that created the object.
>
> Can anyone confirm or refute this? I think making the realm field final
> would be good practice regardless.
>
> -Will
Previous Topic:[databinding] Binding same TableViewer with 2nd input
Next Topic:ObservableCollectionTreeContentProvider duplicate TreeNode creation
Goto Forum:
  


Current Time: Thu Jul 17 19:39:24 EDT 2025

Powered by FUDForum. Page generated in 0.27781 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top