Cannot share RPC handles between threads
claus.klein at arcormail.de
Wed May 3 06:50:20 UTC 2006
I have a multi-threaded application which makes use of remote
procedure calls (RPC). The application creates an RPC client
handle (via clnt_create) which is afterwards used in different
threads (with appropriate locking of course) to make RPC calls.
This doesn't work if the application is linked against uClibc.
The reason is that there is a subtle difference in the implementation
of the RPC client handle data structure between glibc and uClibc.
The CLIENT structure contains a pointer to an authenticator field of
type AUTH which is allocated in "libc/inet/rpc/auth_none.c".
uClibc implements this by using thread-specific data.
Thus it is only valid in *one* thread (the thread which allocated
the CLIENT structure). RPC calls in other threads fail.
This is different in glibc which allocates the structure within the
global address space which is shared by all threads. Thus the same
CLIENT handle can be used in different threads to make RPC calls.
Is there a reason for the different implementation in uClibc?
Can it be changed? In my opinion it would be nice to have the same
behaviour in glibc and uClibc.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1509 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20060503/b42f1992/attachment.bin
More information about the uClibc