I quote http://en.wikipedia.org/wiki/Reentrant_(subroutine)
Both concepts of reentrant and thread safety relate to how functions handle resources. However, they do not match.
Although the concept of re-entry can affect the external interface of a function, thread safety only affects the implementation of the function, not its external interface.
- In most cases, in order to make a reentrant function without returning, its external interface must be changed so that all data is provided by the calling function.
- For a thread-safe function to be thread-safe, you only need to change the implementation, usually adding synchronization blocks to protect shared resources from simultaneous access on different threads.
Consequently, reconnection is a more fundamental property than thread safety and, by definition, leads to thread safety: each re-entry function is thread safe; however, not every thread-protected function is reentrant.
Kisalay
source share