-
-
Notifications
You must be signed in to change notification settings - Fork 21
Add MF.Config.MAX_VARS_PER_FRAME to limit number of variables read in each frame #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1. use std::list instead of std::vector, for circular iteration 2. list max 5 SimVars reading in very frame 3. VimVars clean() needs update list iterator
use 12 for a while
Hi Sebastian, I also did an implementation, then still wanted to add a new command and more stuff and lost track of it. Attached my last version, which I also tested. I have not yet looked at your code, will be interesting to see how similar it will be ;-). My code also uses std::vector and defaulted to 30. Attached my code: |
Ok, I checked the code now and compared the solutions: Remarks:
|
i don't think a client specific limit makes sense because your tests show that the total number of variables read per frame is the one that matters. I don't think that we need more or less than 30 per frame - maybe 40 - but i don't expect that anyone will adjust it - i am not planning to make it configurable for Mobiflight either. I will wait for the community feedback first - and i might simply adjust the default value with one of the next releases. what is your 2nd idea - I am not sure if i understand right. |
Just check the attached code in the first comment and look for AbortReading. The Collection might be cleared while the reading iteration is going on. Stop iterating over the collection after it is cleared. |
The AbortReading was under the assumption that the Dispatch Callback and the external Simconnect Client calls might run concurrently. I am not sure whether this is the case or completely everything is queued and runs in one thread. If there is no concurrency, then the AbortReading stuff makes no sense. |
@Koseng did you every experiment with the precompile method for RPN? Did that make a difference? |
Yes, I tried and in my experiments it made no difference. |
what's your discord username? |
Wrote you in discord. |
This is a new PR re-using the PR from here #11
MOBIFLIGHT_MAX_VARS_PER_FRAME
has a default value of 30, but it can be set to a new value using the commandMF.Config.MAX_VARS_PER_FRAME.Set.