09-20-2011 12:39 PM
I have a small exe that will stay idle in an event structure while another bigger and separate exe will run concurrently. These two exe are seperate and indepedent.
The small exe is usally idle, sometime for hours, in an event structure. One time, I tried to use it, and it responsed very slowly. Is there a way to make the exe more responsive in this situation when the exe will idle in a event structure for a long time? Thanks!
09-20-2011 12:43 PM
I suspect it got swapped out by the OS. Do you have plenty of RAM?
09-20-2011 11:07 PM
Yeah, RAM is plenty.
09-21-2011 12:08 AM
Hi,
Your event is static/dynamic in nature ? How your VI is behaving when you run it without making exe ? I suspect some code inside your event structure is taking more time.. Plz review your code and post back ..
Thanks
- HS
09-21-2011 08:44 AM
Do you have any timeout event which'll keep it active? I suspect as Altenbach it's been swapped out by OS.
/Y
09-21-2011 01:56 PM
There is no time out caese in the event structure. Is there a need for it? I expected the program to be waiting at the event structure of the event of a boolean. If it is swapped out by the OS, is it a big problem? If it is, how do I fix that?
09-21-2011 01:59 PM
For my event structure, there is only static event. The only event is a value change event of a boolean control. The code in the event structure takes very little time, I checked it. When the code is running regularly, there is not problem. When I don't use the program for a long time and it is idle in the even structure waiting of a value change event, the response is slow.
09-21-2011 02:00 PM
First, you did not really say if the program is fast once it has woken up by an event. Is it?
Try an empty timeout event with a long timeout (e.g. 1 minute). That won't really use any CPU. See if it keeps the code responsive.
09-22-2011 01:34 AM
@jyang72211 wrote:
There is no time out caese in the event structure. Is there a need for it? I expected the program to be waiting at the event structure of the event of a boolean. If it is swapped out by the OS, is it a big problem? If it is, how do I fix that?
I suspect the OS feels the program is inactive if it never does anything and thus swaps it out to disc. Having a timeout case as both me and Altenbach suggest should solve this. The problem is as you've noticed that it takes some time to read back when it wakes up, most probably the cause of what's happening to you.
I dont know if an empty timeout is enough, but it should be.
/Y
09-23-2011 04:18 PM
Once it wakes up, it is goes back to normal speed. I guess I don't have to worry about it too much.