-
Notifications
You must be signed in to change notification settings - Fork 5
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
Questions regarding the problem with atomics #9
Comments
Yeah, we never really had time to run the machine test suite. But we did run into an actual / real problem with embassy executor. Where the executor enter a bad state, the task is marked as woken up but not in the ready list. @Dummyc0m and I have reviewed the code in the embassy executor and can not come up with reasonable possibility for us to be entering that state if load reserve store conditional actually work as expected. And by disabling atomic (it will fall back to use the critical section based executor data structures) we can no longer reproduce the problem as expected. Regarding your question, using portable atomic and placing access into critical section would solve the problem. Because we are practically no long use lr/sc instructions anymore. If anyone have the time / interest in running through the litmus test suite to actually confirm it would be extra nice. |
I tried to run the litmus test suite. The problem is that it is not meant to run on bare metal, and it requires threads and a real operating system underneath. Let me know what you think, and if it is worth spend time on it. |
I was thinking adapting something like free rtos and slap it on there as a few threads with preemptive scheduling. I personally don’t really have a huge interest in confirming it is broken, since losing atomic on an embedded & single core platform like this is honestly not a huge deal. And we confirmed by using critical section we can get embassy to work as expected . |
@Codetector1374, Thank you for the explanation. For me, not using atomics solves all the instability I encountered in my firmware on the CH32V203. |
Good day all,
Not an issue but a question: What exactly is the problem with atomics?
I have read the discussion #59
Is this confirmed by WCH, or by the test mentioned in #59?
Is this a hardware bug in all chips?
How does one know it is the atomic operation causing a problem?Is it enough to put the atomic operation in a critical section by using the portable-atomics crate for example?
Just curious about the recent changes.
Thank you in advance for the explanation!
The text was updated successfully, but these errors were encountered: