GithubHelp home page GithubHelp logo

Not thread-safe about dlfcn-win32 HOT 1 CLOSED

 avatar commented on July 2, 2024
Not thread-safe

from dlfcn-win32.

Comments (1)

TimothyGu avatar TimothyGu commented on July 2, 2024

@wm4 said:

For some reason, library handles are cached (why?), using a global linked list.

They are cached only when RTLD_GLOBAL is specified in dlopen, as POSIX mandates:

Any object loaded by dlopen() that requires relocations against global symbols can reference [...] any objects that were loaded in any dlopen() invocation and which specified the RTLD_GLOBAL flag.

This makes the exported functions unsafe to use in a multithreaded setting.

We never said this project is thread-safe. In fact, in dlfcn.c we specifically said that:

/* Note:
 * MSDN says these functions are not thread-safe. We make no efforts to have
 * any kind of thread safety.
 */

(Can't seem to find the MSDN page right now but I swear I saw somewhere that they are not thread-safe)

Also, POSIX doesn't say that the functions have to be thread safe anyway.

from dlfcn-win32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.