Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default Re: load lib

    Adv wrote:
    > Hi,
    > I get aborted when dlclose() on a gnu/linux box and my code runs as a
    > multithreaded server, so, is dlclose()/dl...() thread-safe? if not, how
    > about elf's auto load? the loaded lib is/isn't thread safe will not be issue
    > here?
    dlclose() will unmap the library from the process.

    Hence, if you are still needing it (perhaps a return address on the
    stack or a virtual destructor or whatever) it will SEGV.

    dlopen/dlclose is probably not thread safe (since it needs to run before
    a thread library is available) but that's an easy fix to wrap them in
    a mutex.


    Gianni Mariani Guest

  2. Similar Questions and Discussions

    1. How can I load load Additional extensions ?
      My OS is Winxp . My web server is apache 2 which is installed as a NT service . My php version is 4.32 , and I extracted it into "c:\php" . I...
    2. my swf doesn't load
      Dnia Fri, 13 Aug 2004 10:16:47 GMT, decorix <decorix@hotmail.com> napisał: My english is poor :) Some serv change filenames (for example:...
    3. I want to load a swf from another swf?
      I want to build a preloader in a movie that loads another hidden movie. After the hidden movie is loaded it become visible and the preloader...
    4. my .swf won't load
      Do you have a limit on your file sizes for that site? Your 6 meg file is there.. Portfolio.swf, but there is another file with lower case p.....
    5. load of ram
      Hi, for a long time we want to detect what is the ram load. Now my question: Is there an easy way, to get the information for the size of a...
  3. #2

    Default Re: load lib

    There are two things, first, I have used some mutexes and I don't want to
    make things more complicated for me :), second, auto loading will not have
    such an issue, will it?
    ?

    How about keep the "handle" (via dlopen()) visible globally, and call
    ldsym() without a mutex involoved in each thread?




    "Gianni Mariani" <gi2nospam@mariani.ws> wrote in message
    news:bf2unu$35b@dispatch.concentric.net...
    > Adv wrote:
    > > Hi,
    > > I get aborted when dlclose() on a gnu/linux box and my code runs as a
    > > multithreaded server, so, is dlclose()/dl...() thread-safe? if not, how
    > > about elf's auto load? the loaded lib is/isn't thread safe will not be
    issue
    > > here?
    >
    > dlclose() will unmap the library from the process.
    >
    > Hence, if you are still needing it (perhaps a return address on the
    > stack or a virtual destructor or whatever) it will SEGV.
    >
    > dlopen/dlclose is probably not thread safe (since it needs to run before
    > a thread library is available) but that's an easy fix to wrap them in
    > a mutex.
    >
    >

    DL Guest

  4. #3

    Default Re: load lib

    >>> Gianni Mariani wrote:

    GM> dlopen/dlclose is probably not thread safe (since it needs to run before
    GM> a thread library is available) but that's an easy fix to wrap them in
    GM> a mutex.

    1. Thread library can be loaded not only by dlopen(), but by runtime
    loader (rtld), such as (/lib|/usr/lib|/usr/libexec)/(ld.so|ld-elf.so|...)
    2. There are issues except simple serialization of accessing dl*() internal
    structures; see recent history of FreeBSD rtld.
    3. Even if function is made thread-safe with explicit serialization, it
    can be used without threading library; again, see FreeBSD implementation
    for malloc().


    -netch-
    Valentin Nechayev Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139