Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Synchronization in ValidateAction's Diagnostician
Synchronization in ValidateAction's Diagnostician [message #1806127] Fri, 03 May 2019 08:07 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 301
Registered: December 2015
Senior Member
Hi,

In ValidateAction, doValidate() of the Diagnostician is overridden, adding synchronization on the Resource/ResourceSet:
https://git.eclipse.org/c/emf/org.eclipse.emf.git/tree/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/action/ValidateAction.java#n307

Why?
Re: Synchronization in ValidateAction's Diagnostician [message #1806133 is a reply to message #1806127] Fri, 03 May 2019 10:01 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6458
Registered: July 2009
Senior Member
Hi

Naively, EMF is not thread-safe so synchronization is irrelevant to EMF. It is the responsibility of EMF applications to ensure thread integrity of EMF in those applications.

Eclipse, comprising an EMF editor on the main/UI thread and a live validator on a worker thread is an EMF application that must ensure its thread integrity. A lock on the ResourceSet provides a simple way of suppressing the concurrency hazard. All applications that run within Eclipse should adopt this protocol that was introduced for the live validator. (Providing any finer degree of synchronization on vanilla EMF would be a nightmare. CDO provides serious synchronization. EMF Transaction provides some reader/writer synchronization.)

Regards

Ed Willink
Previous Topic:[CDO] Server. Adopting MySQL 8.x
Next Topic:Eclipse crashes when editing Ecore models
Goto Forum:
  


Current Time: Sun Sep 22 08:21:50 GMT 2019

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

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

Back to the top