Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Data model and multithread application
EMF Data model and multithread application [message #424515] Tue, 28 October 2008 21:47 Go to next message
VincentL is currently offline VincentLFriend
Messages: 88
Registered: July 2009
Member
Hi,

Is is possible to access the EMF model from multi-thread application?

Is EMF is thread safe?

Are there special methods in EMF that helps to make synchronization between thread or
should the user manages this manually in his application?

Do EMF provides mutexes to lock data structures against concurrent access ?

Thanks,

Regards.

Vincent
Re: EMF Data model and multithread application [message #424516 is a reply to message #424515] Tue, 28 October 2008 21:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000109050005030000020607
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Vincent,

Comments below.


Vincent L. wrote:
> Hi,
>
> Is is possible to access the EMF model from multi-thread application?
It is, and things like the transaction APIs are there to help make it safer.
>
> Is EMF is thread safe?
No more or less so than say DOM or ArrayList.

Keep in mind too that even this code for a thread safe list is not
thread safe

int index = list.indexOf(o);
list.remove(index);

Generally thread safety must be achieved at the highest levels of the
application, with things like jobs and transactions. Fine grained
thread safety is typically an illusion.
>
> Are there special methods in EMF that helps to make synchronization
> between thread or should the user manages this manually in his
> application?
Transactions and Jobs are the ways to go.
>
> Do EMF provides mutexes to lock data structures against concurrent
> access ?
No, EMF provide no locking at all, which is good because it ensures that
EMF will not cause deadlock as you try to build a higher level threading
policy around it.
>
> Thanks,
>
> Regards.
>
> Vincent

--------------000109050005030000020607
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Vincent,<br>
<br>
Comments below.<br>
<br>
<br>
Vincent L. wrote:
<blockquote cite="mid:ge819l$imt$1@build.eclipse.org" type="cite">Hi,
<br>
<br>
Is is possible to access the EMF model from multi-thread application?
<br>
</blockquote>
It is, and things like the transaction APIs are there to help make it
safer.<br>
<blockquote cite="mid:ge819l$imt$1@build.eclipse.org" type="cite"><br>
Is EMF is thread safe?
<br>
</blockquote>
No more or less so than say DOM or ArrayList.<br>
<br>
Keep in mind too that even this code for a thread safe list is not
thread safe<br>
<blockquote>int index = list.indexOf(o);<br>
list.remove(index);<br>
</blockquote>
Generally thread safety must be achieved at the highest levels of the
application, with things like jobs and transactions.&nbsp; Fine grained
thread safety is typically an illusion.<br>
<blockquote cite="mid:ge819l$imt$1@build.eclipse.org" type="cite"><br>
Are there special methods in EMF that helps to make synchronization
between thread or should the user manages this manually in his
application?
<br>
</blockquote>
Transactions and Jobs are the ways to go.<br>
<blockquote cite="mid:ge819l$imt$1@build.eclipse.org" type="cite"><br>
Do EMF provides mutexes to lock data structures against concurrent
access ?
<br>
</blockquote>
No, EMF provide no locking at all, which is good because it ensures
that EMF will not cause deadlock as you try to build a higher level
threading policy around it.<br>
<blockquote cite="mid:ge819l$imt$1@build.eclipse.org" type="cite"><br>
Thanks,
<br>
<br>
Regards.
<br>
<br>
Vincent
<br>
</blockquote>
</body>
</html>

--------------000109050005030000020607--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF Data model and multithread application [message #424519 is a reply to message #424515] Tue, 28 October 2008 23:03 Go to previous message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
> Are there special methods in EMF that helps to make synchronization between
> thread or should the user manages this manually in his application?

Not in core EMF, but there is an EMF Transaction sub-project that allows
you synchronize access through a custom EditingDomain.

http://www.eclipse.org/modeling/emf/?project=transaction#tra nsaction


--Cam
Previous Topic:Memory footprint of common base objects
Next Topic:How to effectively work with packages in ECORE
Goto Forum:
  


Current Time: Thu Apr 25 16:00:33 GMT 2024

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

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

Back to the top