Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: Where to call start()
Topic Summary:
Created On: 20-Mar-2007 00:56
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 20-Mar-2007 00:56
User is offline View Users Profile Print this message


Jesper Gissel

Posts: 88
Joined: 20-Jul-2005

Hi,

I have an active class, Keyboard, where I have overridden the thread loop operation: OMReactive* OMThread::execute(). When I do that, I have to call Keyboard::start() to get it all going.

The question is then where to call start() !?

I have observed, that it has a huge impact on the animation performance when and where it is called. (The only thing that start() does, is resume the newly created thread, which was created suspended.)

1) If it is called in the constructor, it slows down the animation.

2) If I make a statechart on the Keyboard class, with only one state and with start() called on the initial transition, it seem to work very well, but why? And with execute() overridden, there is no event handling left, so the statechart is completly useless for anything else, so it seems like a pretty stupid way to do it!

3) If I switch off animation for the execute() operation and call start() in the constructor, it also works! This is what I'm doing right now.

Where am I supposed to call start()? ... and can anybody tell me what is going on with the animation?

Regards

-------------------------
Jesper Gissel
Johnson Controls Denmark, Marine Controls
Report this to a Moderator Report this to a Moderator
 21-Jun-2007 13:37
User is offline View Users Profile Print this message


Martin Stockl

Posts: 307
Joined: 30-Jun-2004

Three things:

When overloading OMThread::execute() it is always a good idea to disable animation for it... it is an operation that never ends.

Since Rhapsody v6.0 you should invoke startDispatching() instead of invoking start().

Third: The best time to call startDispatching() is after the initialization of your application has completed (all objects instantiated, all relationships initialized, all statemachine behaviors initialized).
Typically it is done from outside of the class instance.
The one who called something like pKeyboard = new Keyboard;
should later on call pKeyboard->startDispatching();

Hope that helps.
Report this to a Moderator Report this to a Moderator
 16-Jul-2007 20:11
User is offline View Users Profile Print this message


Jesper Gissel

Posts: 88
Joined: 20-Jul-2005

Hi Martin,

Thank you for your answer. That helped a lot. But there's one thing I don't understand:
[QUOTE]When overloading OMThread::execute() it is always a good idea to disable animation for it... it is an operation that never ends.[/QUOTE]Why is this a good thing?

-------------------------
Jesper Gissel
Johnson Controls Denmark, Marine Controls
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 1 users logged in.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.