lotus



previous page: 12. Why are reentrant library and system call interfaces good? (Programming threads)
  
page up: Threads Programming FAQ
  
next page: 13. (POSIX) How can I perform a join on any thread? (Programming)

12.1. (DCE, POSIX, UI) When should I use thread-safe "r" library calls? (Programming)




Description

This article is from the Threads Programming FAQ, by Bryan O'Sullivan bos@serpentine.com with numerous contributions by others.

12.1. (DCE, POSIX, UI) When should I use thread-safe "r" library calls? (Programming)

If your system provides threads, it will probably provide a set of
thread-safe variants of standard C library routines. A small number of
these are mandated by the POSIX standard, and many Unix vendors
provide their own useful supersets, including functions such as
gethostbyname_r().

Unfortunately, the supersets that different vendors support do not
necessarily overlap, so you can only "safely" use the standard
POSIX-mandated functions. The thread-safe routines are conceptually
"cleaner" than their stateful counterparts, though, so it is good
practice to use them wherever and whenever you can.

 

Continue to:













TOP
previous page: 12. Why are reentrant library and system call interfaces good? (Programming threads)
  
page up: Threads Programming FAQ
  
next page: 13. (POSIX) How can I perform a join on any thread? (Programming)