Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi everybody,

this is just a question of newbie...: what is most efficient when interfacing FSUIPC:

Write all the reads and then do the execute process, or split the reads in small groups and do an execute process after each group ?

Regards,

Robert

Posted

this is just a question of newbie...: what is most efficient when interfacing FSUIPC:

Write all the reads and then do the execute process, or split the reads in small groups and do an execute process after each group ?

Oh most definitely batch all the reads together. They are only adding a little data to your own processes memory and take no time at all. Each and every Process call makes a Windows process change, queues a message for FS to attend to, makes FSUIPC do things, and then process switches back to you. You don't want to do two of those when one will do! (et cetera).

There is a limitation though. If the total space occupied by your accumulated read/write requests gets to more than about 30000 bytes you'll cause a problem. If you are reading lots of data try to keep it down to 16k chunks to be on the safe side, even if that means more than one Process call per cycle.

Also important for FS performance is the cycle time -- i.e. how often you are reading the same stuff. Attempting to go faster than FS's own frame rate is futile, but definitely try to set a slower rate than that if your application doesn't need frame-rate speeds of operation.

Regards,

Pete

Posted

Thanks Peter,

it seems clear to me now... If I can, I have another question following your answer : during the fsuipc_process, does the process release time for others process, or is it exclusive or with hight priority ? In an other way: is it useful that the whole application using FSUIPC is build with several threads running in the same times regarding the fact that the FSUIPC_process seems to be by far the most CPU time consumer (in my case) ?

Best Regards,

Robert

Posted

during the fsuipc_process, does the process release time for others process, or is it exclusive or with hight priority ? In an other way: is it useful that the whole application using FSUIPC is build with several threads running in the same times regarding the fact that the FSUIPC_process seems to be by far the most CPU time consumer (in my case) ?

Er, umdon't know. The FSUIPC_Process sends a Message, so how the system then does things is up to it. The code in FSUIPC doesn't do anything except (eventually) receive your message, process it, and exits, at which time whether the system returns control directly to you or not I really don't know. I guess it would depend on lots of things, like whether it had any other high priority things to do.

In terms of threading, as I understand it, operating systems like Windows NT, 2000 and XP are pretty good at timeslicing between both processes and threads, but Win 98 and Win Me are not. Considering most folks are moving to Win XP these days I should think judicious use of threading in your own application would be advantageous. You could certainly have the FSUIPC access in a separate thread, with a suitable "Sleep" to control the timing of the requests. That might be better than using Windows timers which can be erratic.

Regards,

Pete

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.