Shared vs static link performance hit --and Windows?

Martin v. Löwis martin at v.loewis.de
Wed Jul 9 01:32:16 EDT 2003


Andrew MacIntyre <andymac at bullseye.apana.org.au> writes:

> AFAIK, Windows & OS/2 don't really use the concept of PIC code for DLLs,
> as the DLLs get mapped into system address space rather than user address
> space, and all processes that access DLL code access the code at the same
> address.

Wrong, atleast for Win32. In Win32, there is no "system address
space"; each process has its separate address space.

Each DLL has a preferred load address, and it is linked to that
address. If the dynamic loader can, at run-time, link the DLL to that
address also, there won't be any relocations. If that address is
already in use, the dynamic loader choses a different address, and
they are not shared across address spaces anymore.

For Python standard DLLs and PYDs, PC/dllbase_nt.txt lists the
addresses that have been assigned for each DLL to avoid conflicts. For
custom extension DLLs, most likely, the linker default is used, which
will conflict with all other DLLs which don't use the /BASE linker
flag, either.

Regards,
Martin




More information about the Python-list mailing list