Creating concrete model using threading [message #677018] |
Tue, 07 June 2011 06:39  |
Eclipse User |
|
|
|
Hi,
I have ecore model and i want to create 1000 XMI models using threading.
I am using
EOperation.Internal.InvocationDelegate.Factory.Registry.INSTANCE.put(oclDelegateURI,
new OCLInvocationDelegateFactory.Global());
EStructuralFeature.Internal.SettingDelegate.Factory.Registry.INSTANCE.put(oclDelegateURI, new OCLSettingDelegateFactory.Global());
When i create 1000 model in one thread then every thing works fine and it calculates every derived property but when i use multiple threads for less execution time it gives exception in delegation and says concurrent access.
Is the delegation being used is thread safe?
what is right procedure to make it work in multi threaded environment?.
Please help me
|
|
|
|
|
|
Re: Creating concrete model using threading [message #686639 is a reply to message #677129] |
Wed, 22 June 2011 12:26   |
Eclipse User |
|
|
|
Hi
In response to your disjoint queries, by warming up, I mean executing
all the code once so that all caches are populated. As I wrote
You probably need to do an EPackage content traversal to perform a
practice eGet and eInvoke for everything with a delegate EAnnotation.
Regards
Ed Willink
On 07/06/2011 17:18, Ed Willink wrote:
> Hi
>
> We discussed this in an earlier thread and suspected that delegates
> would not be threadsafe. I'm afraid you've just confirmed it.
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=348606 raised.
>
> You can probably avoid the problem by warming the delegates up in
> single-threaded before launching the others. I would recommend
> creating all Resource classes from a single thread too if the
> ResourceSet is shared.
>
> You probably need to do an EPackage content traversal to perform a
> practice eGet and eInvoke for everything with a delegate EAnnotation.
>
> This could be a generally useful routine, that would be worth making
> available to others, until it perhaps becomes redundant in Juno if the
> bug is fixed. But even then it might be good to be able to warm up
> anyway.
>
> Regards
>
> Ed Willink
>
>
>
>
> On 07/06/2011 11:39, forums-noreply@eclipse.org wrote:
>> Hi,
>>
>> I have ecore model and i want to create 1000 XMI models using threading.
>> I am using
>> EOperation.Internal.InvocationDelegate.Factory.Registry.INSTANCE.put(oclDelegateURI,
>> new OCLInvocationDelegateFactory.Global());
>> EStructuralFeature.Internal.SettingDelegate.Factory.Registry.INSTANCE.put(oclDelegateURI,
>> new OCLSettingDelegateFactory.Global());
>>
>> When i create 1000 model in one thread then every thing works fine
>> and it calculates every derived property but when i use multiple
>> threads for less execution time it gives exception in delegation and
>> says concurrent access.
>>
>> Is the delegation being used is thread safe?
>>
>> what is right procedure to make it work in multi threaded environment?.
>>
>> Please help me
>
|
|
|
|
|
|
Re: Creating concrete model using threading [message #693298 is a reply to message #693033] |
Wed, 06 July 2011 04:23  |
Eclipse User |
|
|
|
Hi,
I meant to have 1 model having 999 mutations.
As i have been reading ImpactAnalyzer's java doc, All constructors requires OCL Expression which means i would need one object of Impact analyzer for every derived property.
So i could ask my first question like "Impact Analyzer is bound to one OCL Expression and for every derived property i need to have one impact analyzer object"?
My second question was that i want to generate code from my meta model at run time and then instanciate generated code 1000 times each instantiation represent one mutation of concrete model(means set the non derived properties and calculate derived ones).
Which methodology is better with respect to performance ImpactAnalyzer or Code generation?
Sorry if my questions are not well elaborated
Warmest Regards,
|
|
|
Powered by
FUDForum. Page generated in 0.04231 seconds