Skip to content
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

Don't change global settings which affect the overall process or the floating point control word of the CPU on preemptive systems #39

Open
MBlesken opened this issue Apr 19, 2022 · 4 comments

Comments

@MBlesken
Copy link

Just like the specification the IG should make a remark such as "To prepare the FMU code to run reliably on preemptive systems FMI functions must not change global settings." in the https://modelica.github.io/fmi-guides/main/fmi-guide/#_global_state section

@pmai
Copy link
Collaborator

pmai commented Apr 19, 2022

That is already what that section says, and that is true regardless of preemption...

@andreas-junghanns
Copy link
Contributor

@MBlesken : can you close this issue?

@MBlesken
Copy link
Author

@MBlesken : can you close this issue?

@andreas-junghanns Hm, I don't think that @pmai and I have the same opinion on that section (> That is already what that section says, and that is true regardless of preemption...)
"The functions the FMU provides must not change global settings which affect the overall process and/or thread environment" makes sense to me but "FMU funtions can, on the other hand, change the floating point control word of the CPU during their execution,..." seems to me like an exception that should have a remark on preemption. What do you think?

@pmai
Copy link
Collaborator

pmai commented Apr 26, 2022

Not really, because any sane preemptive scheduling system will save CPU/FPU state in context switches (i.e. this is by definition per-thread/task info). I.e. can you point to a preemptive scheduling system that screws this up nowadays? And if there are, they are going to be restricted in many other ways too (i.e. no MMU, no FPU, ...), so specific care would be needed to target them anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants