When should we use thread-safe "_r" library calls?
Answers were Sorted based on User's Feedback
Answer / guest
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.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / vidya
If you compile using _REENTRANT option, the thread-safe
functions are automatically substituted for the non thread
safe function. You need not specify *_r, you only use *
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain critical section?
What are the main families of threads?
what are the Architectural differences between User-space threads, and Kernel-supported threads.
Explain what is scheduling?
When should we use thread-safe "_r" library calls?
explain about the initial process sequence while the system boots up?
what is Scheduling?
Explain what is protection boundary?
What are threads?
What is the window of the working set of a process?
Explain what is critical section?
Explain the performance differences between user-space threads and kernel-supported threads.?