Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Load lib

0 views
Skip to first unread message

Adv

unread,
Jul 16, 2003, 1:05:07 PM7/16/03
to
Hi all,
In a gnu/linux environment, the libmylib.so itself is thread safe, if I keep
one lib handle opened via dlopen() globally visible to all thread without
pthread_mutex protection, will dlsym() for geting function address and
making the call cause any problem? how about elf's autoloading when app's
start up?

TIA


Adv


Loic Domaigne

unread,
Jul 17, 2003, 9:08:19 AM7/17/03
to
Hi!

> In a gnu/linux environment, the libmylib.so itself is thread safe, if I keep
> one lib handle opened via dlopen() globally visible to all thread without
> pthread_mutex protection, will dlsym() for geting function address and
> making the call cause any problem?

IMOH, this question is not related to the fact that your libmylib.so
is thread safe (although this feature might be highly desirable when
linking to a MT process), nor to the dynamic linking loader operations
dlopen(), dlsym()...

I believe, you can re-formulate your question as follows:

"If I have a variable shared by all threads without any pthread_mutex
protection, will a read access to this variable cause any problem?".

So I guess, that's merely a "standard question" on multi-threading...


> how about elf's autoloading when app's start up?

Do you mean, the dynamic libraries associated to a program that are
loaded when the program is executed? I believe, there is no issue
here, since all the libs needed are loaded at start-up, long before
any threads get created.


Does it answer your questions?

Regards,
Loic.

0 new messages