EMF Data model and multithread application [message #424515] |
Tue, 28 October 2008 17:47  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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. 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--
|
|
|
|
Powered by
FUDForum. Page generated in 0.26002 seconds