Operating System - HP-UX
1832207 Members
2737 Online
110040 Solutions
New Discussion

Re: Multithreaded library naming format in HP-UX

 
sachi_naik
Occasional Contributor

Multithreaded library naming format in HPUX

Hello,

 

For some reasons I need to exclude dynamically loading (dlopen) a multithreaded library in my program.

 

Anyone knows if I can do the below:

        if (strcmp(lib_pathname + strlen(lib_pathname) - 5, "mt.sl") != 0)
        {
                      lib_handle = shl_load(lib_pathname,
                        BIND_IMMEDIATE | BIND_VERBOSE, 0L); /* Load the DLL now */
                }
        }

 

to not load multithreaded versions of the libraries ?

 

Here i am assuming that the naming convention of multithreaded libraries are xxxxxmt.sl

 

Any better way to handle this scenario ?

 

Thanks and Regards

Sachi

 

 

1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: Multithreaded library naming format in HP-UX

>I need to exclude dynamically loading (dlopen) a multithreaded library in my program.

 

You are out of luck.  There is no convention.

All HP-UX system shlibs are suppose to work threaded or not, dynamically.

But this means you can't load libpthread and libc.

And other shlibs must use software TLS (pthread_getspecific) and not hardware.

 

>Any better way to handle this scenario?

 

Only by compiling with dynamic TLS.  But I'm not sure that was ever implemented completely on PA-RISC.