<s>
In	O
computing	O
,	O
the	O
Netscape	B-Application
Portable	I-Application
Runtime	I-Application
,	O
or	O
NSPR	B-Application
,	O
a	O
platform	B-Device
abstraction	O
library	O
,	O
makes	O
all	O
operating	B-General_Concept
systems	I-General_Concept
it	O
supports	O
appear	O
the	O
same	O
to	O
(	O
for	O
example	O
)	O
Mozilla-style	O
web-browsers	B-Application
.	O
</s>
<s>
NSPR	B-Application
provides	O
platform	B-Operating_System
independence	I-Operating_System
for	O
non-GUI	O
operating	B-General_Concept
system	I-General_Concept
facilities	O
.	O
</s>
<s>
shared	O
library	B-Library
linking	I-Library
.	O
</s>
<s>
Much	O
of	O
the	O
library	O
,	O
and	O
perhaps	O
the	O
overall	O
thrust	O
of	O
it	O
in	O
the	O
Gromit	O
environment	O
,	O
provides	O
the	O
underpinnings	O
of	O
the	O
Java	B-Language
virtual	I-Language
machine	I-Language
,	O
more	O
or	O
less	O
mapping	O
the	O
sys	O
layer	O
that	O
Sun	O
defines	O
for	O
the	O
porting	O
of	O
the	O
Java	B-Language
VM	I-Language
to	O
various	O
platforms	B-Device
.	O
</s>
<s>
NSPR	B-Application
does	O
go	O
beyond	O
that	O
requirement	O
in	O
some	O
areas	O
,	O
as	O
it	O
also	O
functions	O
as	O
the	O
platform-independent	B-Operating_System
layer	O
for	O
most	O
of	O
the	O
servers	O
produced	O
by	O
Netscape	B-Protocol
.	O
</s>
<s>
The	O
first	O
generation	O
of	O
NSPR	B-Application
originally	O
aimed	O
just	O
to	O
satisfy	O
the	O
requirements	O
of	O
porting	O
Java	B-Language
to	O
various	O
host	O
environments	O
.	O
</s>
<s>
In	O
2009	O
,	O
NSPR	B-Application
still	O
functioned	O
appropriately	O
as	O
the	O
platform-dependent	O
layer	O
under	O
Java	B-Language
,	O
but	O
it	O
also	O
served	O
in	O
supporting	O
clients	O
written	O
entirely	O
in	O
C	B-Language
or	O
in	O
C++	B-Language
.	O
</s>
<s>
NSPR	B-Application
has	O
the	O
goal	O
of	O
providing	O
uniform	O
service	O
over	O
a	O
wide	O
range	O
of	O
operating-system	O
environments	O
.	O
</s>
<s>
It	O
strives	O
not	O
to	O
export	O
the	O
lowest	O
common	O
denominator	O
,	O
but	O
to	O
exploit	O
the	O
best	O
features	O
of	O
each	O
operating	B-General_Concept
system	I-General_Concept
on	O
which	O
it	O
runs	O
,	O
while	O
still	O
providing	O
a	O
uniform	O
service	O
across	O
a	O
wide	O
range	O
of	O
host	O
offerings	O
.	O
</s>
<s>
Threads	B-Operating_System
feature	O
prominently	O
in	O
NSPR	B-Application
.	O
</s>
<s>
The	O
software	B-Application
industry	I-Application
's	O
offering	O
of	O
threads	B-Operating_System
lacks	O
consistency	O
.	O
</s>
<s>
NSPR	B-Application
,	O
while	O
far	O
from	O
perfect	O
,	O
does	O
provide	O
a	O
single	O
API	O
to	O
which	O
clients	O
may	O
program	O
and	O
expect	O
reasonably	O
consistent	O
behavior	O
.	O
</s>
<s>
The	O
operating	B-General_Concept
systems	I-General_Concept
provide	O
everything	O
from	O
no	O
concept	O
of	O
threading	O
at	O
all	O
up	O
to	O
and	O
including	O
sophisticated	O
,	O
scalable	O
and	O
efficient	O
implementations	O
.	O
</s>
<s>
NSPR	B-Application
makes	O
as	O
much	O
use	O
of	O
what	O
the	O
systems	O
offer	O
as	O
it	O
can	O
.	O
</s>
<s>
NSPR	B-Application
aims	O
to	O
impose	O
as	O
little	O
overhead	O
as	O
possible	O
in	O
accessing	O
those	O
appropriate	O
system	O
features	O
.	O
</s>
<s>
Thread	B-Operating_System
synchronization	O
loosely	O
depends	O
on	O
monitors	O
as	O
described	O
by	O
C	B-Language
.	O
A	O
.	O
R	O
.	O
Hoare	O
in	O
"	O
Monitors	O
:	O
An	O
operating	B-General_Concept
system	I-General_Concept
structuring	O
concept	O
"	O
,	O
Communications	O
of	O
the	O
ACM	O
,	O
17(10 )	O
,	O
October	O
1974	O
and	O
then	O
formalized	O
by	O
Xerox	O
 '	O
Mesa	B-Language
programming	I-Language
language	I-Language
(	O
"	O
Mesa	B-Language
Language	O
Manual	O
"	O
,	O
J.G.	O
</s>
<s>
This	O
mechanism	O
provides	O
the	O
basic	O
mutual	O
exclusion	O
(	O
mutex	B-Operating_System
)	O
and	O
thread	B-Operating_System
notification	O
facilities	O
(	O
condition	O
variables	O
)	O
implemented	O
by	O
NSPR	B-Application
.	O
</s>
<s>
Additionally	O
,	O
NSPR	B-Application
provides	O
synchronization	O
methods	O
more	O
suited	O
for	O
use	O
by	O
Java	B-Language
.	O
</s>
<s>
The	O
Java-like	O
facilities	O
include	O
monitor	O
reentrancy	O
,	O
implicit	O
and	O
tightly	O
bound	O
notification	O
capabilities	O
with	O
the	O
ability	O
to	O
associate	O
the	O
synchronization	O
objects	O
dynamically	O
.	O
</s>
<s>
NSPR	B-Application
's	O
I/O	B-General_Concept
slightly	O
augments	O
the	O
Berkeley	B-Protocol
sockets	I-Protocol
model	O
and	O
allows	O
arbitrary	O
layering	O
.	O
</s>
<s>
The	O
designers	O
originally	O
intended	O
to	O
export	O
synchronous	O
I/O	B-General_Concept
methods	O
only	O
,	O
relying	O
on	O
threads	B-Operating_System
to	O
provide	O
the	O
concurrency	O
needed	O
for	O
complex	O
applications	O
.	O
</s>
<s>
That	O
method	O
of	O
operation	O
remains	O
preferred	O
,	O
though	O
one	O
can	O
configure	O
the	O
network	O
I/O	B-General_Concept
channels	O
as	O
non-blocking	O
in	O
the	O
traditional	O
sense	O
.	O
</s>
<s>
Part	O
of	O
NSPR	B-Application
deals	O
with	O
manipulation	O
of	O
network	O
addresses	O
.	O
</s>
<s>
NSPR	B-Application
defines	O
an	O
IP-centric	O
network	O
address	O
object	O
.	O
</s>
<s>
While	O
it	O
does	O
not	O
define	O
the	O
object	O
as	O
opaque	O
,	O
the	O
API	O
provides	O
methods	O
that	O
allow	O
and	O
encourage	O
clients	O
to	O
treat	O
the	O
addresses	O
as	O
polymorphic	B-Application
items	O
.	O
</s>
<s>
In	O
this	O
area	O
NSPR	B-Application
aims	O
to	O
provide	O
a	O
migration	O
path	O
between	O
IPv4	B-Protocol
and	O
IPv6	B-Protocol
.	O
</s>
<s>
To	O
that	O
end	O
one	O
can	O
perform	O
translations	O
of	O
ASCII	B-Protocol
strings	O
(	O
DNS	B-Protocol
names	I-Protocol
)	O
into	O
NSPR	B-Application
's	O
network	O
address	O
structures	O
,	O
regardless	O
of	O
whether	O
the	O
addressing	O
technology	O
uses	O
IPv4	B-Protocol
or	O
IPv6	B-Protocol
.	O
</s>
<s>
NSPR	B-Application
makes	O
timing	O
facilities	O
available	O
in	O
two	O
forms	O
:	O
interval	O
timing	O
and	O
calendar	O
functions	O
.	O
</s>
<s>
Interval	O
timers	O
are	O
based	O
on	O
a	O
free	B-Language
running	O
,	O
32-bit	O
,	O
platform-dependent	O
resolution	O
timer	O
.	O
</s>
<s>
Such	O
timers	O
are	O
normally	O
used	O
to	O
specify	O
timeouts	O
on	O
I/O	B-General_Concept
,	O
waiting	O
on	O
condition	O
variables	O
and	O
other	O
rudimentary	O
thread	B-Operating_System
scheduling	O
.	O
</s>
<s>
Since	O
these	O
timers	O
have	O
finite	O
namespace	O
and	O
are	O
free	B-Language
running	O
,	O
they	O
can	O
wrap	O
at	O
any	O
time	O
.	O
</s>
<s>
NSPR	B-Application
does	O
not	O
provide	O
an	O
epoch	O
,	O
but	O
expects	O
clients	O
to	O
deal	O
with	O
that	O
issue	O
.	O
</s>
<s>
Additionally	O
there	O
are	O
routines	O
to	O
convert	O
to	O
and	O
from	O
most	O
well-known	O
forms	O
of	O
ASCII	B-Protocol
into	O
the	O
64-bit	O
NSPR	B-Application
representation	O
.	O
</s>
<s>
NSPR	B-Application
provides	O
API	O
to	O
perform	O
the	O
basic	O
malloc	B-Language
,	O
calloc	B-Language
,	O
realloc	B-Language
and	O
free	B-Language
functions	O
.	O
</s>
<s>
Depending	O
on	O
the	O
platform	B-Device
,	O
the	O
functions	O
may	O
be	O
implemented	O
almost	O
entirely	O
in	O
the	O
NSPR	B-Application
runtime	O
or	O
simply	O
shims	B-General_Concept
that	O
call	O
immediately	O
into	O
the	O
host	O
operating	B-General_Concept
system	I-General_Concept
's	O
offerings	O
.	O
</s>
<s>
Support	O
for	O
linking	O
(	O
shared	O
library	O
loading	O
and	O
unloading	O
)	O
forms	O
part	O
of	O
NSPR	B-Application
's	O
feature	O
set	O
.	O
</s>
<s>
In	O
most	O
cases	O
this	O
is	O
simply	O
a	O
smoothing	O
over	O
of	O
the	O
facilities	O
offered	O
by	O
the	O
various	O
platform	B-Device
providers	O
.	O
</s>
