12.1 Purpose of a Library

Ideally, a library is an NLMâ„¢ that exports entry points for other NLMs to use and has no active threads because the calling threads (from the other NLMs) execute the library code and consume the functionality the library provides. A service, in contrast to a library, is an NLM that performs work on behalf of callers, perhaps blocking the calling threads until the service is performed.

The NLM that is dependent upon the library usually auto loads the library. Once the library is loaded, other modules can register and use its symbols. If this happens, the operating system maintains a dependency list for the library and prevents it from being unloaded until all dependent modules have severed the relationship by unregistering the library.