-
Notifications
You must be signed in to change notification settings - Fork 2k
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
xtimer: broken on 'native` when with thread_flags #6642
Comments
The problem seems to be broken scheduling behavior in native, |
@haukepetersen I agree that the ISRs must be allowed to run to finish before switching contexts. |
I faced a similar situation when implementing the Maybe that was then a native pitfall after all but IIRC @OlegHahm saw the same behaviour in a SAM platform. EDIT: found the #6441 (comment). The board was a |
Agree, this is not only a should, but a MUST! So it seems this behavior is (to some extend) related to #6442. The question is how we can fix this once and for all... IMHO this should be a high priority thing to do, but I don't have the know-how to fix this. Anyone else volunteering? |
Maybe I don't it right, but why do you assume that the ISR does not run to completion? I can't neither see it from the native code (just calling |
I'll put together a test application to demonstrate this behavior. |
done: #6659 |
#6660 fixes the issue for me. |
refining #6624
The following code hangs after the first timeout on native:
After a quick debugging session I might have found a lead: it seems like native is doing an early context switch from its interrupt context back to the main thread when calling
thread_flags_set()
. The second call toxtimer_set()
exits in_lltimer_set()
without setting the new timer, because_in_handler
is still set. If I see it correctly, the_in_handler
being set because the_timer_callback()
function never actually exists -> hence it seems like the switch from interrupt to thread context is happening early.I am not sure however, how this should be fixed?! Are there maybe some
if (in_isr())
checks missing in the thread_flags implementation?The text was updated successfully, but these errors were encountered: