Thread Safe and Rentrancy

view full story

http://www.unix.com – I have read at many places that a thread-safe function is always reentrant, but a reentrant function is not always thread-safe. I understand the second part that reentrant function is not always thread-safe, since the reentrant function works on each of the thread's local data and so if the reentrant function is accessing any global data in it then it cannot be threadsafe. But will anybody explain with example how can a threadsafe function be always reentrant? (HowTos)