Hi all
Just opened my process explorer for the fun of it, and saw that the FlyNet client uses approximately 45-50% CPU just waiting at the log-on screen. :shock: (that's when it is idle.....)
That tells me that something could or indeed should be optimized in the code.
Not even FS in idle condition uses that much....(6-10%)
That is to me, a pretty heavy load on the machine to do what? Report back to the host once in a while?...Hm....there must be a better way.....
FlyNet client uses CPU
Moderators: Guru's, The Ministry
I've made a small program that listens to events in the clipboard, more or less the same way the Client do (or should do) (it uses FSUIPC.dll as an interface/API to FS)
But it (my program) really doesn't listen (like a service) it is triggered by an event, a windows event passed on from the clipboard, via the windows kernel. Not the same thing. There should be no activity in the "listener" at all as long as the event from the client (here FS and Windows) isn't fired.
If it's made more or less like a service, then there will be activity all the time, like you say: it listens on a specific thread or two for anything to process....
But a client-type application like the FlyNet Client shouldn't be written as a service, but as an event driven application. Thus using no CPU-power when idle....a service is "never" idle...
But it (my program) really doesn't listen (like a service) it is triggered by an event, a windows event passed on from the clipboard, via the windows kernel. Not the same thing. There should be no activity in the "listener" at all as long as the event from the client (here FS and Windows) isn't fired.
If it's made more or less like a service, then there will be activity all the time, like you say: it listens on a specific thread or two for anything to process....
But a client-type application like the FlyNet Client shouldn't be written as a service, but as an event driven application. Thus using no CPU-power when idle....a service is "never" idle...
- Chris Trott
- Vintage Pair
- Posts: 2589
- Joined: 26 Jun 2004, 05:16
- Location: Wichita Falls, Texas, USA
- Contact:
However remember that the client is controlling certain items via FSUIPC during the entire flight like restricting your sim rate (not allowing more than what's allowed for the flight), preventing modification of anything under the "Aircraft" menus, and failures. I don't know much about programming, but it seems to me that those items would require active monitoring of the program and not passive monitoring such as has been suggested.
Active monitoring can be seen in two ways....
One way is to "subscribe" to events from a "client" (here FS)
Another is to constantly "cast out a request" to see if there are any pending jobs to do...
This is spelled out very literally, just as to give the picture...
The first one doesn't require much processing as long as the client hasn't send a so called message (event) to the subscriber.
The latter continues to use processor time because of the constant "surveillance" of processes which need to be taken care of....
See the difference? It's a lot more technical than that, but I don't think this is the place to go deeper into programming techniques..
FSUIPC is it self an IPC (Inter-Process-Communicator) a program that hooks itself upon a running process, and being able to read and write to this process in a common understandable way. The FlyNet uses this library in its communication with FS, but there are always several ways of getting the same result. As I obviously haven't read the source-code for the FlyNet client, I can only "guesstimate" whats going on behind the lines, but using approximately 50% processor time in an idle condition, doesn't seem streamlined to me. Remember i said idle, FS isn't even started at this moment....!
One way is to "subscribe" to events from a "client" (here FS)
Another is to constantly "cast out a request" to see if there are any pending jobs to do...
This is spelled out very literally, just as to give the picture...
The first one doesn't require much processing as long as the client hasn't send a so called message (event) to the subscriber.
The latter continues to use processor time because of the constant "surveillance" of processes which need to be taken care of....
See the difference? It's a lot more technical than that, but I don't think this is the place to go deeper into programming techniques..
FSUIPC is it self an IPC (Inter-Process-Communicator) a program that hooks itself upon a running process, and being able to read and write to this process in a common understandable way. The FlyNet uses this library in its communication with FS, but there are always several ways of getting the same result. As I obviously haven't read the source-code for the FlyNet client, I can only "guesstimate" whats going on behind the lines, but using approximately 50% processor time in an idle condition, doesn't seem streamlined to me. Remember i said idle, FS isn't even started at this moment....!
- Chris Trott
- Vintage Pair
- Posts: 2589
- Joined: 26 Jun 2004, 05:16
- Location: Wichita Falls, Texas, USA
- Contact: