linux - Are *_r UNIX calls reentrant (async-signal safe), thread safe or both? -


there difference in re-entrant , thread-safe functions , don't know if linux functions ending _r thread-safe, re-entrant (i mean async-signal safe) or both,

they thread-safe.

stevens/rago apue teaches distinction between thread-safe functions (reentrant respect being called multiple threads), , async-signal-safe functions (reentrant respect signal handlers, can called safely within signal handler).

apue ch 12.5 reentrancy lists ~79 functions not thread-safe, ~11 have equivalents are reentrant, *_r functions. means 11 can called multiple threads @ same time.

apue ch 10.6 reentrant functions lists ~135 functions async-signal-safe. block signal delivery when needed. so, can use them in signal handler code. note, async-signal-safeness matters when functions called inside signal handler. may motivate 1 not write signal handler code, further details tricky.

kerrisk tlpi ch 21 signals: signal handlers has own table of functions async-signal-safe. interestingly not quite same apue.

none of *._r listed async-signal-safe either of these references.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -