On Tue, Jun 27, 2006 at 04:14:37PM +0100, Christian Smith wrote:

> Anyway, it's not difficult to provide thread local storage. HP-UX's 
> netdb.h functions (gethostbyname etc.) are fully re-entrant despite 
> returning 'static' data, for example. Other UNIXs got hamstrung with 
> various getXbyY_r implementations, with horrible semantics.

Well yes, the *_r functions are often pretty ugly to use.  But they
work great if what you want to do is build your own thread local
storage version on top!

I've always assumed there's some good reason for the existence and use
of *_r functions rather than equivalent thread local storage versions,
although I've never been sure just what it is.

-- 
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com/

Reply via email to