Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCLSettingDelegate extension
OCLSettingDelegate extension [message #714659] Thu, 11 August 2011 08:12 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

According to my experience, OCLSettingDelegate is not thread safe. I need to calculate the values of attributes of all classes for 1000 models. If i do it in single thread then it takes a lot of time (low performance). If i use multi threading then OCLSettingDelegate is not thread safe. I want to extend OCLSettingDelegate in order to try to make it thread safe. Can you guide me in this regard. I am trying to follow http://wiki.eclipse.org/EMF/New_and_Noteworthy/Helios#Defining_a_Setting_Delegate

The second part of question is "will OCLSettingDelegate be thread safe in upcomming version"?
Re: OCLSettingDelegate extension [message #714689 is a reply to message #714659] Thu, 11 August 2011 09:32 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Follwoing an earlier query
https://bugs.eclipse.org/bugs/show_bug.cgi?id=348606 is open to fix
this, but I'm afraid it does not have high priority.

If you're sufficiently motivated to try to fix it for yourself, we would
be grateful if you provide a patch so that it is fixed for everyone.

To do this you need to check out the org.eclipse.ocl.ecore plugin from
GIT and enhance the classes in the delegate package with appropriate
synchronize declarations. You may also need to check out the inherited
EMF classes (but I hope those are ok).

Regards

Ed Willink


On 11/08/2011 09:12, ModelGeek wrote:
> Hi,
>
> According to my experience, OCLSettingDelegate is not thread safe. I
> need to calculate the values of attributes of all classes for 1000
> models. If i do it in single thread then it takes a lot of time (low
> performance). If i use multi threading then OCLSettingDelegate is not
> thread safe. I want to extend OCLSettingDelegate in order to try to
> make it thread safe. Can you guide me in this regard. I am trying to
> follow
> http://wiki.eclipse.org/EMF/New_and_Noteworthy/Helios#Defining_a_Setting_Delegate
>
> The second part of question is "will OCLSettingDelegate be thread safe
> in upcomming version"?
Re: OCLSettingDelegate extension [message #716046 is a reply to message #714689] Tue, 16 August 2011 09:49 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

As i mentioned URL http://wiki.eclipse.org/EMF/New_and_Noteworthy/Helios#Defining_a_Setting_Delegate
This tutorial guides to extends BasicSettingDelegate.Stateless.
Is this method recommended to have specialized delegates?

Regards,
Re: OCLSettingDelegate extension [message #716212 is a reply to message #716046] Tue, 16 August 2011 16:48 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi
> As i mentioned URL
> http://wiki.eclipse.org/EMF/New_and_Noteworthy/Helios#Defining_a_Setting_Delegate
> This tutorial guides to extends BasicSettingDelegate.Stateless. Is
> this method recommended to have specialized delegates?
By 'method' do you mean 'approach' or 'Java function'.

The N&N was written before OCL delegates were actually implemented. The
real OCL delegates are provided by Eclipse OCL so you have
no need to implement them, but may want to revise them to make them
thread safe.

The actual delegates are nominally stateless, but they have lazily
initialized caches. Placing synchronized around the cache initializations
and the 'pointers' to the delegates could cure the thread safety.

If you are asking about EMF delegates in general, you should perhaps ask
on the EMF newsgroup.

Regards

Ed Willink
Previous Topic:extract elements from a collection
Next Topic:(no subject)
Goto Forum:
  


Current Time: Thu Apr 25 10:24:02 GMT 2024

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

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

Back to the top