Let me make sure if I understood right.
Suppose the followings:
* A application is thread-unsafe and compiled without the -D_POSIX_C_SOURCE flag
and linked with libc.so.
* B application is thread-safe and compiled with the -D_POSIX_C_SOURCE flag and
linked with libpthread.so.
* A and B don't spawns any threads by pthread_create in programs.
In this case, for releases of Solaris prior to 10(9? because Solaris 9 don't
spawn thread),
the following callings is not supported.
- A calls B using dlopen.
- A calls B directly without using dlopen.
- B calls A using dlopen.
- B calls A directly without using dlopen.
Is my understanding right?
Thank you,
Enokida
Sent: Wednesday, February 21, 2007 12:08 PM
Subject: Re: [osol-code] Any problems with providing only shared librarys
linked with libpthread.so
Tsutomu Enokida wrote:
Thank you for your reply.
I think from the following display of lwps command of dbx that when a
nonthreaded program,
which is thread-unsafe and linked with libpthread.so, calls my shared
library, four more threads
are created, and then main thread plus the four threads run at the same
time because my shared
library is compiled with the -D_POSIX_C_SOURCE flag and linked with
libpthread.so.
Do four threads except main thread cause problems for thread-unsafe
caller program?
Enokida
Ah... your library is not only thread-safe, it is thread hot in that
it creates threads and needs threads to work in order to function
correctly.
In Solaris 10 or better, this works even for thread unsafe applications
so long as you don't execute any application supplied callbacks in any
context besides the main thread.
For releases of Solaris prior to 10, this is not supported. In
particular, dlopenning libraries that are thread-hot from non-mt safe
programs is known not to work well.
- Bart
Bart Smaalders Solaris Kernel Performance
[EMAIL PROTECTED] http://blogs.sun.com/barts
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code