Properties of dynamic link libraries in Windows (dll)

AarCee

As per Microsoft (see first point in this), a DLL can have only one instance of itself running in a system at one time, but from what I read at other places online including here on SO, processes can load multiple instances of the same dll and read only data in dll may be shared using memory mapping techniques but each process has its own copy of write data from dll stored in its own memory space.

Also, in the second point at the same link, a DLL can't have its own stack, memory handles, global memory, etc, but from what I understand, since there can be multiple functions exported and/or inside a dll, these must have their own stacks, file handles, etc. And why can't a global variable defined in a DLL be considered as using global memory?

I'm working in C++.

Nandu

the context of a DLL used in singular won't make much sense. To get better understanding, use DLL's in conjunction with the context of being loaded in a process. The documentation is correct. Threads that are part of code/exported functions within DLL will have their stack. Processes have Memory handles, global memory..etc not individual threads. If you have a global variable defined in DLL, its global in the context of the process that it's mapped to. If a DLL is mapped to multiple processes, then each process gets it's own global variable. It's part of maintaining process isolation/integrity (each process has it's own memory area, handle tables..etc)

HTH

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Is it possible for multiple Dynamic Link Libraries (DLL) to share Thread Local Storage from a Static Library (LIB)

From Dev

Makefile link shared (dynamic) libraries

From Dev

Proper way to link static libraries with dll

From Dev

Unable to link the grpc libraries in Windows

From Dev

Why cant you statically link dynamic libraries?

From Dev

Electron running SQLlite 3 on Windows - A dynamic link library (DLL) initialization routine failed

From

Calling Golang from Java using JNI on Windows leads to "A dynamic link library (DLL) initialization routine failed"

From Dev

Shared libraries on Windows - dependencies using wrong dll

From Dev

The problem of link order when dynamic link libraries depend on each other

From Dev

Rename the link in .dll (relink, Windows)

From Dev

Build tesseract as DLL Dynamic link library

From Dev

Dynamic linking boost libraries and the auto-link not working properly?

From Dev

Run-time vs link-time linking of dynamic libraries

From Dev

How to link shared library *dll with CMake in Windows

From Dev

Delphi link to windows dll statically or dynamically

From

Use windows dll libraries in go, compiled for linux and mac os x

From Dev

Unable to link openssl libraries to CLion C program on windows with cygwin

From Dev

[cmake]how to include and link system libraries on windows using cmake

From Dev

How can I correctly link OpenCV libraries to Eclipse on Windows?

From Dev

Extracting Windows File Properties with http link

From Dev

Could not be located in dynamic link library php4ts.dll

From Dev

The ordinal 3283 could not be located in the dynamic link library libmysql.dll

From Javascript

Electron Uncaught Error: A dynamic link library (DLL) initialization routine failed

From Dev

C#: A dynamic link library (DLL) initialization routine failed

From Dev

Compaq Visual Fortran 6.6, Dynamic-Link Library (DLL) and Module

From Dev

Server library could not be loaded and the dynamic link library LIBPQ.dll

From Dev

FMUException: Error loading the binary. Could not load the DLL: A dynamic link library (DLL) initialization routine failed

From Dev

Tensorflow : DLL load failed: A dynamic link library (DLL) initialization routine failed

From Dev

How does Visual studio know which library to link if both static and dynamic libraries exit?

Related Related

  1. 1

    Is it possible for multiple Dynamic Link Libraries (DLL) to share Thread Local Storage from a Static Library (LIB)

  2. 2

    Makefile link shared (dynamic) libraries

  3. 3

    Proper way to link static libraries with dll

  4. 4

    Unable to link the grpc libraries in Windows

  5. 5

    Why cant you statically link dynamic libraries?

  6. 6

    Electron running SQLlite 3 on Windows - A dynamic link library (DLL) initialization routine failed

  7. 7

    Calling Golang from Java using JNI on Windows leads to "A dynamic link library (DLL) initialization routine failed"

  8. 8

    Shared libraries on Windows - dependencies using wrong dll

  9. 9

    The problem of link order when dynamic link libraries depend on each other

  10. 10

    Rename the link in .dll (relink, Windows)

  11. 11

    Build tesseract as DLL Dynamic link library

  12. 12

    Dynamic linking boost libraries and the auto-link not working properly?

  13. 13

    Run-time vs link-time linking of dynamic libraries

  14. 14

    How to link shared library *dll with CMake in Windows

  15. 15

    Delphi link to windows dll statically or dynamically

  16. 16

    Use windows dll libraries in go, compiled for linux and mac os x

  17. 17

    Unable to link openssl libraries to CLion C program on windows with cygwin

  18. 18

    [cmake]how to include and link system libraries on windows using cmake

  19. 19

    How can I correctly link OpenCV libraries to Eclipse on Windows?

  20. 20

    Extracting Windows File Properties with http link

  21. 21

    Could not be located in dynamic link library php4ts.dll

  22. 22

    The ordinal 3283 could not be located in the dynamic link library libmysql.dll

  23. 23

    Electron Uncaught Error: A dynamic link library (DLL) initialization routine failed

  24. 24

    C#: A dynamic link library (DLL) initialization routine failed

  25. 25

    Compaq Visual Fortran 6.6, Dynamic-Link Library (DLL) and Module

  26. 26

    Server library could not be loaded and the dynamic link library LIBPQ.dll

  27. 27

    FMUException: Error loading the binary. Could not load the DLL: A dynamic link library (DLL) initialization routine failed

  28. 28

    Tensorflow : DLL load failed: A dynamic link library (DLL) initialization routine failed

  29. 29

    How does Visual studio know which library to link if both static and dynamic libraries exit?

HotTag

Archive