Skip to content

general_dynamicloading

shekh edited this page Apr 15, 2018 · 1 revision

VirtualDub Plugin SDK 1.2

Dynamic loading

The plugins definitions in the SDK are designed to allow dynamic loading, where a host loads plugins only when needed. This reduces memory footprint and resource usage, and also sidesteps a problem with thread-local storage (TLS) handles on older operating systems — these are in short supply per thread, and can be exhausted without dynamic loading as one is consumed for every instance of the Microsoft C runtime library (CRT) loaded in memory.

Dynamic loading is mostly invisible to plugins, since the host automatically shadows important data from the plugin and loads the plugin only when necessary. However, this does mean that the plugin should load and unload quickly. Also, if the plugin needs to stay in memory longer, such as to wait for shutdown or for the user to close status UI, the plugin can keep itself in memory by incrementing its DLL reference count, such as by the Win32 LoadLibrary() or GetModuleHandleEx() functions; the plugin won't unload when the host disconnects, and when it reconnects, it will use the DLL that is still resident.


Copyright (C) 2007-2012 Avery Lee.

Clone this wiki locally