Skip to end of banner
Go to start of banner

Reentrancy and Thread Safety

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Q

What is Reentrancy and Thread-Savety?

A

Depending on definition Reentrancy (= Interrupt Safety) and Thread Safety are two different things.

Reentrant: Reentrant functions can be called recursively and can be called simultaneously by two or more processes. Reentrant functions are often required in real-time applications or in situations where interrupt code and non-interrupt code must share a function (see keil).

Thread Safe: Thread-safe code only manipulates shared data structures in a manner that ensures that all threads behave properly and fulfill their design specifications without unintended interaction (see Wikipedia). Thread-Safety is required when using an operating system and functions are called by different threads.

Q

Which Functions are reentrant/ Thread-Safe?

A

Thread-Safe: When thread safety is required, the developer needs to use thread safe functions. Is many cases thread safety of non thread safe functions can be archieved using mutex fuctionalities.




  • No labels