It is currently Wed May 22, 2013 9:58 am


All times are UTC - 7 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: AtPollEvent performance
PostPosted: Mon Apr 30, 2007 8:05 am 

Joined: Thu Mar 29, 2007 4:26 pm
Posts: 7
Hello,

The first AtPollEvent call I make appears to "time out" and take on the order of 800-1500 ms on a per interface basis. After that each successive call takes somewhere between 0-20ms (which is acceptable). Each dsn we run gets its own copy of the Altia Runtime via the AtStartInterface(..) call. I've tried making a call to AtSetDesignId before the first poll but it didn't appear to have any effect. Does anyone know of any solutions?

I am running Altia Runtime 8.0.6.2, with a multi-threaded TCP/IP Socket option, on Windows XP. As mentioned in this forum, I am connecting to AtStartInterface with the command line option "-port" specified for localhost.

Any questions, do not hesitate to contact me.

Thanks as always,
Tucker


Top
Offline Profile  
 
 Post subject:
PostPosted: Mon Apr 30, 2007 8:07 am 

Joined: Thu Mar 29, 2007 4:26 pm
Posts: 7
One thing I forgot to mention was the reason I am polling to begin with. We have a set of different dsn's with objects we want to clone. I need an easy way, from code, to get the object id's to pass to AtCreateClone. Perhaps there is a better way?

Tucker


Top
Offline Profile  
 
 Post subject:
PostPosted: Tue May 01, 2007 11:17 am 

Joined: Wed Aug 02, 2006 4:50 pm
Posts: 281
Location: Colorado
Hi, Tucker.

Quote:
I need an easy way, from code, to get the object id's to pass to AtCreateClone. Perhaps there is a better way?

Can you tell me more about this? What are you polling to get the IDs? Usually, the code that clones knows what the object IDs of the objects to be cloned are. As an alternative to polling (assuming each object has some sort of animation that you assign the object id), you could "announce" all the appropriate object IDs when the design is first loaded via adding a WHEN altiaInitDesign.


Quote:
The first AtPollEvent call I make appears to "time out" and take on the order of 800-1500 ms on a per interface basis.

Only 1 PollEvent takes this long for the entire execution process? Or is it 1 PollEvent per loop that takes this long?

If you're running a firewall, try turning it off (especially if it's Norton). If you are using Norton, check out: http://www.altia.com/forums/viewtopic.php?t=830

Best regards,
Jason

_________________
Altia.com - User Interface Design Tools and GUI Software


Top
Offline Profile  
 
 Post subject:
PostPosted: Thu May 03, 2007 2:18 pm 
V.P. of Engineering

Joined: Wed Aug 02, 2006 3:15 pm
Posts: 67
Location: Altia Colorado Springs HQ
Regarding the first AtPollEvent call timing out, does this mean that it
returns -1 and the value for the animations is wrong? Or is it just that
it takes a long time, but in the end returns 0 and the value for the
animation is good?

If it returns 0 and the value is good, then it simply took a long time for
Altia Runtime to respond to the poll. For example, is there a lot of
control that the design executes at start-up time that might keep it
from responding to client events for 1 to 2 seconds?

Or, if multiple threads or processes are trying to start Altia Runtime
sessions, this is going to cause some delays until all of the threads
and/or processes have their Altia Runtimes executing. The multi-
threaded versions of the Altia API use blocking mutexes to protect
themselves from being entered by multiple threads simultaneously
(i.e., only one thread can be inside the API at any given time).

Hope this information is helpful.

_________________
Tom Walton
Altia, Inc.


Top
Offline Profile  
 
 Post subject:
PostPosted: Tue May 08, 2007 1:43 pm 

Joined: Thu Mar 29, 2007 4:26 pm
Posts: 7
tomw wrote:
Regarding the first AtPollEvent call timing out, does this mean that it
returns -1 and the value for the animations is wrong? Or is it just that
it takes a long time, but in the end returns 0 and the value for the
animation is good?

The latter. It returns the correct value and exits gracefully by returning 0.

tomw wrote:
If it returns 0 and the value is good, then it simply took a long time for
Altia Runtime to respond to the poll. For example, is there a lot of
control that the design executes at start-up time that might keep it
from responding to client events for 1 to 2 seconds?

Aha! Yes there this. This would explain why it's only the first AtPoll event that appears to take a "long time." After further debugging, I believe this must be the case, since there is much less delay on faster machines.

tomw wrote:
Or, if multiple threads or processes are trying to start Altia Runtime
sessions, this is going to cause some delays until all of the threads
and/or processes have their Altia Runtimes executing. The multi-
threaded versions of the Altia API use blocking mutexes to protect
themselves from being entered by multiple threads simultaneously
(i.e., only one thread can be inside the API at any given time).

Hope this information is helpful.

I had noticed this too, and guessed as much.

Thanks, Tom.

Tucker


Top
Offline Profile  
 
 Post subject:
PostPosted: Tue May 08, 2007 1:56 pm 

Joined: Thu Mar 29, 2007 4:26 pm
Posts: 7
jasonw wrote:
Hi, Tucker.

Can you tell me more about this? What are you polling to get the IDs? Usually, the code that clones knows what the object IDs of the objects to be cloned are. As an alternative to polling (assuming each object has some sort of animation that you assign the object id), you could "announce" all the appropriate object IDs when the design is first loaded via adding a WHEN altiaInitDesign.

I am polling an animation to return the appropriate ID. There are potentially hundreds of objects to be cloned in each our design files, which we import from XML. Each of these animations on these objects has a common suffix, so we attach our prefix in code before polling to retrieve the object ID. We then store the object ID to use with AtCreateClone. This was so we didn't have to "know" the object ID a priori, which is probably the better solution, as you allude to.

I'm more interested to hear about the alternative to polling and "announcement." Assuming I have an animation that already has the correct object ID stored, how can I get the value back? The two methods I am familiar with are through AtPollEvent and through AtAddCallback, but I thought the latter required the value to change to trigger the callback. It sounds as though I can use altiaInitDesign to trigger the callback to announce the IDs?

I wonder if I'm already doing that. Thanks for the response; I think I need to think about this some more.

Tucker


Top
Offline Profile  
 
 Post subject:
PostPosted: Wed May 09, 2007 2:28 pm 

Joined: Wed Aug 02, 2006 4:50 pm
Posts: 281
Location: Colorado
Quote:
Each of these animations on these objects has a common suffix, so we attach our prefix in code before polling to retrieve the object ID.

How do you know what prefix to use? Are there just some known text names like "power_"?


Quote:
I'm more interested to hear about the alternative to polling and "announcement."

altiaInitDesign is a built-in animation that gets set when the design is loaded.

I'm thinking that each object can have a tiny piece of Control code on it and perhaps they can all report their IDs to a single animation. For instance, if the object ID was held in an animation called 862_objID, it might look like this:
Code:
WHEN altiaInitDesign ==
  EXPR _global_MyCloneID == 862_objID
END
Then the code on a different item might be:
Code:
WHEN altiaInitDesign ==
  EXPR _global_MyCloneID == 1273_objID
END
You'd end up with a string of numbers sent to the _global_MyCloneID animation at startup. You could then use AtSelectEvent/AtNextEvent or AtAddCallback to process those incoming numbers whenever you wanted (just like any other event).

I use the _global_ prefix here since it doesn't get renamed when you copy an object. That way, new objects you create from copy/paste will be all set to announce themselves.

_________________
Altia.com - User Interface Design Tools and GUI Software


Top
Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net