title: Difference between thread safe and async-signal safe
body: <p>According to APUE 2e Chapter 12.5:</p>
  
  <blockquote>
    <p>If a function is reentrant with respect to multiple threads, we say that it is thread-safe. This doesn't tell us, however, whether the function is reentrant with respect to signal handlers. We say that a function that is safe to be reentered from an asynchronous signal handler is async-signal safe. </p>
  </blockquote>
  
  <p>My questions are</p>
  
  <p>Q1:</p>
  
  <p>Is there a "general re-entrant" concept (which means re-entrantcy in all circumstances)? If there is, does general re-entrant equal to re-entrant with respect to both multi-thread and async-signal only? Or is there also a third  condition that has to be considered when talking about general re-entrant?</p>
  
  <p>Q2:</p>
  
  <p>Thread safety doesn't imply async-signal safety, which is obvious. But, does async-signal safety imply thread safety for sure? I googled a lot, people are saying that it does, but I can't find any source for it.</p>
  
  <p>Q3:</p>
  
  <p>If answers to both Q1 and Q2 are yes, I guess general re-entrant just equals to async-signal safe?</p>