Quantcast
Viewing all articles
Browse latest Browse all 4890

SDK • Re: is there a list of API functions, which are safe to call from Interrupt Context?

Deadlock is only one concern with Interrupt/multicore function access. Another is data consistency vs corruption.
Usually functions, which are declared as thread-safe or interrupt-safe or multicore-safe need to take some extra steps to ensure that, such as mutexes or disabling interrupts or using memory barriers, etc.
And this declaration is a part of function contract, which is maintained over versions.

Now, I read time_us_64 implementation and see that it appears to be well written and safe (except I am not sure whether accesses to timer_hw members can be reordered or not on this platform - are you?)
but without such explicit safety declaration, how can I be sure that it safe and will not change in the future?

Statistics: Posted by jhnlmn — Sat Feb 24, 2024 1:38 am



Viewing all articles
Browse latest Browse all 4890

Trending Articles