Reentrancy

Reentrancy

Post by Greg Sternberg/PDS I » Wed, 10 Jan 1996 04:00:00



   I'm working on a program that uses DCE and RPC calls.  We've just recently
discovered that not all the function calls in the libc we are using are
reentrant (strtok() as an example).  Does anyone know of a reentrant library
for Unix, or know where there is some source already written reentrant
routines, or have another suggestion as to how to avoid reentrancy
problems ?

Thanks,
Greg Sternberg
--
CompuServ: 75511,65          "I don't know - I'm making this up as I go along."

 
 
 

Reentrancy

Post by ARMAND Christop » Thu, 11 Jan 1996 04:00:00



:    I'm working on a program that uses DCE and RPC calls.  We've just recently
: discovered that not all the function calls in the libc we are using are
: reentrant (strtok() as an example).  Does anyone know of a reentrant library
: for Unix, or know where there is some source already written reentrant
: routines, or have another suggestion as to how to avoid reentrancy
: problems ?

I am quite convinced the answer depends on the OS you use. Let's say
you work on a solaris based station. Then you should read the
_Multithreaded_Programming_Guide_ freely distributed by Sun at

http://www.Sun.COM/sunsoft/Developer-products/sig/threads/usersGuides...

for instance. Chapter 5 discusses this kind of pb.

More precisely, a new function strtok_r(3C) was introduce as the
reentrante version of strtok() (on page 104 stands the list of these
new function)

Hope this helps.

--
+---------------------------+--------------------------------------+

| Ecole Centrale Paris (Fr) | WWW: http://www.cti.ecp.fr/~armandn6 |o  Ooo
+---------------------------+---------------------------oo---------+  o o
                                                      o  oo  _____ o oo
                                                          o (_/-\_) oo
                                                           ===(S) o

 
 
 

Reentrancy

Post by Douglas Kosovi » Thu, 11 Jan 1996 04:00:00



>    I'm working on a program that uses DCE and RPC calls.  We've just
> recently discovered that not all the function calls in the libc we
> are using are reentrant (strtok() as an example).  Does anyone know
> of a reentrant library for Unix,

> Thanks,
> Greg Sternberg

For OSF/1 (don't know anout other O/Ss) libc_r is the reentrant version
of libc and strtok_r() is the reentrant version of strtok().

Doug.

 
 
 

1. Dynamic Memory Allocation Reentrancy

Are the memory allocation routines in C/C++ malloc/new reentrant in Solaris?

I'm having problems making dynamic memory allocations in signal handlers
in Solaris 2.4 (Sparc).  I have a signal handler that makes dynamic memory
allocations, but if the signal interrupts a memory allocation in progress
in the normal mainline code, I will eventually get a bus error or
segmentation fault.  My only work around currently is to surround the memory
allocation routines with calls to sigblock() and sigrelese().  Needless
to say this is very inefficient and awkward.

The same code(pre-port) runs fine under SunOS 4.1.3.  It never had a problem
with dynamic memory allocation in signal handlers.

Is there a way out of this predicament?

                                                                   Edward

2. Vesa X-Server

3. inet_addr reentrancy?????? or MT safeness???

4. Linux DSL Connection - What about this?

5. Kernel modules' re-entrancy

6. Solaris 7 and 250 meg zip drive

7. Xlib reentrancy question

8. Using MMDF as an actual mail server.

9. Reentrancy of getenv() and putenv() ?

10. malloc re-entrancy

11. Good books on the design of OS, re-entrancy, Dragon Book etc.

12. Reentrancy

13. Malloc() reentrancy problem