FlyNet client uses CPU

Check here to keep abreast of FSAirlines updates.

Moderators: Guru's, The Ministry

Post Reply
User avatar
DanKH
Battle of Britain
Battle of Britain
Posts: 3526
Joined: 02 Dec 2004, 10:53
Location: EKCH, Denmark
Contact:

FlyNet client uses CPU

Post by DanKH »

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.....
Best Rgds
Dan
Image
Image Image
Who's General Failure, and why is he reading my harddisk?

User avatar
TobyV
Vintage Pair
Vintage Pair
Posts: 2862
Joined: 26 Jun 2004, 20:41
Location: Halfway up a hill

Post by TobyV »

Not sure what its written in, but presumably it contains a thread or two, one listening for windows events as all Windows programs must do, and presumably another listening for FS events during flight progress. Certainly it cant really have much in the way of serious number crunching to do :think:

User avatar
DanKH
Battle of Britain
Battle of Britain
Posts: 3526
Joined: 02 Dec 2004, 10:53
Location: EKCH, Denmark
Contact:

Post by DanKH »

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...
Best Rgds
Dan
Image
Image Image
Who's General Failure, and why is he reading my harddisk?

User avatar
Chris Trott
Vintage Pair
Vintage Pair
Posts: 2589
Joined: 26 Jun 2004, 05:16
Location: Wichita Falls, Texas, USA
Contact:

Post by Chris Trott »

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.

User avatar
DanKH
Battle of Britain
Battle of Britain
Posts: 3526
Joined: 02 Dec 2004, 10:53
Location: EKCH, Denmark
Contact:

Post by DanKH »

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....!
Best Rgds
Dan
Image
Image Image
Who's General Failure, and why is he reading my harddisk?

User avatar
Chris Trott
Vintage Pair
Vintage Pair
Posts: 2589
Joined: 26 Jun 2004, 05:16
Location: Wichita Falls, Texas, USA
Contact:

Post by Chris Trott »

The only thing to remember is that FlyNET is still in beta as well, so Konny may not have streamlined it because of BETA coding, especially some of the outputs he has programmed in during the flight.

User avatar
DanKH
Battle of Britain
Battle of Britain
Posts: 3526
Joined: 02 Dec 2004, 10:53
Location: EKCH, Denmark
Contact:

Post by DanKH »

A second thing to remember is that it isn't Konny that does the programming of the client now, it's DaKurt.....
Best Rgds
Dan
Image
Image Image
Who's General Failure, and why is he reading my harddisk?

Post Reply