This article has multiple issues. Please helpimprove it or discuss these issues on thetalk page.(Learn how and when to remove these messages) (Learn how and when to remove this message)
|
TheNetscape Portable Runtime, orNSPR, is a cross-platformabstraction layer library for theC programming language. It provides a uniformAPI for various operating system functions.[2]
NSPR was originally designed to provide a base for theJava virtual machine inNetscape 5. Over time, it was extended to allow support for additional functionality used for Netscape's server and client software.[3] NSPR continues to be used today by Firefox as well as many of Oracle and Red Hat's server products.[2]
NSPR provides athread API. It uses the OS's threading capabilities where possible. It also provides support for sharing memory between threads, as well as creating and using thread pools.Locks,atomics,semaphores, and both cached and uncachedmonitors are provided.[4]
NSPR provides functions for working with files, directories,anonymous pipes andnetwork sockets.[4]
NSPR defines anIP-centric network address object. Functions are provided to translateASCII strings (DNS names) into NSPR's network address structures, regardless of whether the addressing technology uses IPv4 or IPv6.[3][4]
NSPR makes timing facilities available in two forms: interval timing and calendar functions.
Interval timers are based on a free-running 32-bit resolution timer. Theirepoch and interval can be set as needed.
Calendar times are represented using 64-bit signedUnix time. NSPR provides functions for manipulating and converting timestamps.[3][4]
NSPR provides API to perform the basicmalloc,calloc,realloc andfree functions. Depending on the platform, the functions may be implemented almost entirely in the NSPR runtime or simplyshims that call immediately into the host operating system's offerings.[3][4]
Support for linking (shared library loading and unloading) forms part of NSPR's feature set. In most cases, this is simply a smoothing over of the facilities offered by the various platform providers.[3][4]
NSPR provides implementations of acircular linked list and ahash table.[4]