On Wed, 21 Feb 2007, Tsutomu Enokida wrote:

The following programs work well. Is there any conditions?

Non-trivial testcases. Your 'libsub1.so' doesn't _DEPEND_ on being compiled -D_POSIX_C_SOURCE=..., it makes no use of any threading facilities whatsoever.

What does the code below prove/disprove ?

FrankH.


cc -xCC -G -D_POSIX_C_SOURCE=199506L sub1.c -o libsub1.so -lpthread
cc dltest.c -ldl

-- dltest.c --------------------------------
main() {
void * hd1;
int (*fptr1)(void);

if(!(hd1=dlopen("libsub1.so",RTLD_NOW)))
printf("dlopen %s\n",dlerror());
if(!(fptr1=(int(*)())dlsym(hd1,"sub1")))
printf("dlsym %s\n",dlerror());
(*fptr1)();
}

-- sub1.c ---------------------------------
sub1() {

return 0;
}
-----------------------------------------

Thank you,
Enokida

Sent: Wednesday, February 21, 2007 4:55 PM
Subject: Re: [osol-code] Any problems with providing only shared librarys linked with libpthread.so

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.

I think it's even worse: even if a program is compiled MT-safe, then
it still can't open libraries which start threads because some things
get confused.

Casper


_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to