Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [MWE2] How to execute components in parallel?
[MWE2] How to execute components in parallel? [message #647484] Thu, 06 January 2011 15:39 Go to next message
Eclipse UserFriend
Originally posted by: kuehnlenz.informatik.hu-berlin.de

Hi,

I need to specify a set of components that are executed in parallel (via
Java threads).

Usual all components in a workflow are executed sequentially. I would
like to have some block structure that encapsulates common MWE2 components.

e.g.:

workflow {
component = CommonMWE2Component1 { }

parallelBlock {
// executes each component as separate Java thread
// terminates, if the last component in this block terminates
component = CommonMWE2Component2 { }
component = CommonMWE2Component3 { }
}

component = CommonMWE2Component4 {
// starts, after parallelBlock has terminated
}
}

What is the best way to implement something similar? Or is it planned to
extend MWE2 in that direction?

I found two things that may help:
First the cartridge concept, but the control flow is also only
sequentially here.

module myPack.A
@otherPack.B {
foo = "Bar"
}

module otherPack.B
var foo
MyComponent {
zonk = foo
}


Second, there exists also a class CompositeComponent that could be a
starting point since its a container for other components.

What would you suggest? BTW: Is the context mechanism thread-safe?

Thanks in advance and all the best,
Frank
Re: [MWE2] How to execute components in parallel? [message #647596 is a reply to message #647484] Fri, 07 January 2011 09:22 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Hi Frank!

I think it should be possible to derive a custom workflow component from org.eclipse.emf.mwe.core.container.CompositeComponent and then do the parallization within the invoke() method.

It is not planned to add a language concept for that.

You should be really careful what you really could execute in parallel. I don't know if the context is thread-safe. It is not designed for parallel execution, so expect that you might face issues.

~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: [MWE2] How to execute components in parallel? [message #648850 is a reply to message #647596] Fri, 14 January 2011 17:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kuehnlenz.informatik.hu-berlin.de

> I think it should be possible to derive a custom workflow component from
> org.eclipse.emf.mwe.core.container.CompositeComponent and then do the
> parallization within the invoke() method.
OK, thanks. I implemented it that way and it works nicely.


> It is not planned to add a language concept for that.
I see the use cases for MEW2 and understand that parallelism is not
necessary for these use cases.
But nevertheless in general for a workflow engine parallelism is a
central concept.


> You should be really careful what you really could execute in parallel.
> I don't know if the context is thread-safe. It is not designed for
> parallel execution, so expect that you might face issues.
Actually I have no problems, yet.

All the best
Frank
Re: [MWE2] How to execute components in parallel? [message #649008 is a reply to message #648850] Mon, 17 January 2011 09:00 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
The name Modeling *Workflow* Engine is somewhat misleading, as it lacks
most concepts you'd expect from a real workflow engine. Rather than
that, it is a framework for declaratively instantiating and wiring up
Java objects.

Note that while it might be feasible to introduce parallelism in some
cases, this requires the executed components to be thread safe, which is
*not* the case for most components shipped with MWE. Furthermore, they
all share a writable context. So be very careful here.

Am 14.01.11 18:24, schrieb Frank Kuehnlenz:
>> I think it should be possible to derive a custom workflow component from
>> org.eclipse.emf.mwe.core.container.CompositeComponent and then do the
>> parallization within the invoke() method.
> OK, thanks. I implemented it that way and it works nicely.
>
>
>> It is not planned to add a language concept for that.
> I see the use cases for MEW2 and understand that parallelism is not
> necessary for these use cases.
> But nevertheless in general for a workflow engine parallelism is a
> central concept.
>
>
>> You should be really careful what you really could execute in parallel.
>> I don't know if the context is thread-safe. It is not designed for
>> parallel execution, so expect that you might face issues.
> Actually I have no problems, yet.
>
> All the best
> Frank


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Previous Topic:same qualifiedName in ecore files
Next Topic:xtext complete examples including xpand
Goto Forum:
  


Current Time: Thu Apr 25 09:09:13 GMT 2024

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

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

Back to the top