Skip to main content



      Home
Home » Modeling » EMF » EMF Data model and multithread application
EMF Data model and multithread application [message #424515] Tue, 28 October 2008 17:47 Go to next message
Eclipse UserFriend
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 17:58 Go to previous messageGo to next message
Eclipse UserFriend
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--
Re: EMF Data model and multithread application [message #424519 is a reply to message #424515] Tue, 28 October 2008 19:03 Go to previous message
Eclipse UserFriend
> 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: Tue Jul 08 19:40:16 EDT 2025

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

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

Back to the top