From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,915496c75a4ca0d7 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-07-20 10:47:19 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!MathWorks.Com!yeshua.marcam.com!charnel.ecst.csuchico.edu!olivea!decwrl!pa.dec.com!nntpd.lkg.dec.com!jac.zko.dec.com!granda.zk3.dec.com!neth From: neth@granda.zk3.dec.com (Craig Neth USG) Newsgroups: comp.unix.osf.osf1 Subject: Re: Problems with Shared Libraries Date: 20 Jul 1994 17:28:36 GMT Organization: Digital Equipment Corporation Distribution: world Message-ID: <30jms4$cup@jac.zko.dec.com> References: <30jf4l$g7g@msuinfo.cl.msu.edu> Reply-To: neth@granda.zk3.dec.com (Craig Neth USG) NNTP-Posting-Host: granda.zk3.dec.com X-Newsreader: mxrn 6.18-17 In article <30jf4l$g7g@msuinfo.cl.msu.edu>, scottge1@cps.msu.edu (George M. Scott) writes: |> |>I have noticed the following problem when using shared libraries on OSF/1 2.0. |>I have a program which loads shared libraries dynamically using dlopen/dlsym. |>This program is compiled with only the C library. |> |>Now if I create shared libraries that use libc.so, libm.so, or even libcxx.so |>everything is fine when loaded with dlopen. However if the library |>has dependencies of the form -lpthreads -lmach -lcxx -lc_r -lc, and the |>library contains global c++ constructors which make pthreads calls then |>the library cannot be properly loaded and initialized. [...] |>Does anyone know the true cause of this problem? I talked to the loader expert, and this is how he explained it to me. (The words are mine, paraphrased from a conversation). Your application is attempting to change from single-threaded (linked against libc, which is single threaded) to multi-threaded _while_ it is running. This just plain does not work; it's not even clear that it can be made to work. Right now, you need to keep things consistent. If the libraries you need to dlopen are multi-threaded, the main image needs to be linked against the thread libraries. |>Is DEC going to fix it? The threads and libraries people are working on trying to make this work, but it isn't soup yet.... The next major release (after the one we are releasing this summer) would be the first opportunity for this work to show up _if_ they figure out how to do it. -- -------------------------------------------------------------------------------- Craig Neth ! neth@zk3.dec.com Digital Equipment Corporation ! 110 Spit Brook Road ZKO3-3/Y25 ! Nashua, NH 03062 ! Opinions expressed herein are my own. ================================================================================