Why are malloc() and printf() said as non-reentrant?

malloc and printf usually use global structures, and employ lock-based synchronization internally. That’s why they’re not reentrant. The malloc function could either be thread-safe or thread-unsafe. Both are not reentrant: Malloc operates on a global heap, and it’s possible that two different invocations of malloc that happen at the same time, return the same memory … Read more

Threadsafe vs re-entrant

TL;DR: A function can be reentrant, thread-safe, both or neither. The Wikipedia articles for thread-safety and reentrancy are well worth reading. Here are a few citations: A function is thread-safe if: it only manipulates shared data structures in a manner that guarantees safe execution by multiple threads at the same time. A function is reentrant … Read more

Is process in VHDL reentrant?

No event will ever occur while a process is running! When a process is woken by an event, it runs to completion (“end process”) or an explicit “wait” statement, and goes to sleep. This takes, notionally, ZERO time. Which means that if you have loops in your process, they are effectively unrolled completely, and when … Read more