Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF: thread safety for read only access to an EMF resource(EMF: thread safety for read only access to an EMF resource)
EMF: thread safety for read only access to an EMF resource [message #1760702] Tue, 02 May 2017 08:49 Go to next message
Neil Mackenzie is currently offline Neil MackenzieFriend
Messages: 101
Registered: December 2013
Senior Member
Hello.
I was wondering if access to an EMF Resource is thread safe for read only access.
e.g. If I load a resource using java (say from an XMI file) and then make sure all proxies are resolved, and then access the elements from many threads (only reading values from the model, and never changing it) , is there any risk of deadlocks.
Thanks,
Neil
Re: EMF: thread safety for read only access to an EMF resource [message #1760711 is a reply to message #1760702] Tue, 02 May 2017 10:07 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5573
Registered: July 2009
Senior Member
Hi

See https://wiki.eclipse.org/EMF/FAQ#Is_EMF_thread-safe.3F

You suggestions are close and might work. However proxies are not the only lazy hazard. I would recommend running a representative workload on a single thread to populate all lazy caches before letting multiple threads have a go. Particularly necessary for UML and/or OCL that are 'lazier'.,

Regards

Ed Willink
Re: EMF: thread safety for read only access to an EMF resource [message #1760758 is a reply to message #1760711] Tue, 02 May 2017 16:34 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 29112
Registered: July 2009
Senior Member
Yes, generally if all proxies are resolved, read-only access should not further modify the state of the model and it should be thread safe. We rely on that with Oomph's heavy use of EMF models, for example...
Previous Topic:[CDO] Correct usage of CDOView in a multithreaded application
Next Topic:Missing references
Goto Forum:
  


Current Time: Wed Jan 17 02:51:21 GMT 2018

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

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