Zurück zu Willert.de

Using Rhapsody Generated Library

Rhapsody Model or Codegeneration topics

Using Rhapsody Generated Library

Postby BadRoy » December 3rd, 2013, 12:34 am

I've built an GHS Integrity library with Rhapsody and include it in an existing Integrity project. During main(), I create an instance of the main library object (Let's call it myRhapBuilderObject) - in the constructor I initialize the framework and call start ( OXF::initialize(64, 0, true) { OXF::start(true); } ). This all appears to work and I can see the framework threads in the Multi debugger. The problem then is that my main OMThread (the myRhapBuilderObject thread) comes up halted. If I manually start it (within the Multi debugger) it runs fine. I just can't seem to get it to come up running out of the gate - probably something dumb. Anyone else run into this?
Posts: 1
Joined: December 2nd, 2013, 11:18 pm

Re: Using Rhapsody Generated Library

Postby Skywalker » December 5th, 2013, 12:25 pm

Does not sound familiar to me... but from what I see you should at least verify the right ordering.
A valid sequence is:
1. initialize framework (calling OXF::initialize() with appropriate arguments),
2. create your objects which may later use the OXF,
3. start framework main thread as background task (calling OXF::start(true)),
4. return to caller and continue there.

If you create user objects to early (before OXF::initialize), then they may try to access framework singleton objects before they were explicitly initialized. In that case they will be initialized with default arguments and your later initialization arguments will be ignored, since the OXF was initialized implicitly.

If you create user objects (which shall run on main context) to late (after OXF::start(true)), then you may cause race conditions, since these objects could fire events during their construction (if startBehavior() is called in Ctor), and so the dispatching context (which is running in the background already) may try to handle them (e.g. OMStartBehavior or short tm()), even before the construction was fully completed.

Which version of Rhapsody do you use in that project?
You ensured to link the non-instrumented version of oxf?

Hope this helps.
May the force be with you ...
Posts: 74
Joined: October 31st, 2007, 5:09 pm
Location: Milkyway, classic 9-planet solar system

Return to Modelling with Rhapsody

Who is online

Users browsing this forum: No registered users and 4 guests