client-side synchronization (or lack thereof)

Joseph Marques jmarques at redhat.com
Wed Dec 22 06:30:00 UTC 2010


On 12/21/2010 05:16 PM, Jay Shaughnessy wrote:
>   modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java |   37 ++++++++--
>   modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java |    3
>   2 files changed, 34 insertions(+), 6 deletions(-)
>
> New commits:
> commit a2619e9946f686fdb50f161df01766d88964980f
> Author: Jay Shaughnessy<jshaughn at redhat.com>
> Date:   Tue Dec 21 17:14:28 2010 -0500
>
...
>      I've protected add/remove portlet using some synchronization but it we need
>      to go further we may need to put a locking mechanism in place.
 From the "Multithreading and Synchronization" section here -- 
http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsCompatibility.html

"JavaScript interpreters are single-threaded, so while GWT silently 
accepts the synchronized keyword, it has no real effect. 
Synchronization-related library methods are not available, including 
Object.wait(), Object.notify(), and Object.notifyAll(). The compiler 
will ignore the synchronized keyword but will refuse to compile your 
code if the Object's related synchronization methods are invoked.

So this either needs to be remedied by disallowing further actions 
(i.e., disabling buttons) until the first one completes, or by 
persisting the individual dashboard delta (instead of the entire set of 
portlets for the dashboard being modified) which would remove the race 
condition.


More information about the rhq-devel mailing list