The USER_MODE feature enables support for user mode actors that require direct access to the microkernel API.
This feature provides support for unprivileged actors, running in separate virtual user address spaces (when available).
USER_MODE
is used in all memory models.
For details, see USER_MODE(5FEA).
The GZ_FILE
feature enables dynamically loaded actors
and dynamic libraries to be uncompressed at load time, prior to execution.
This minimizes the space required to store these compressed files and the
download time.
The GZ_FILE
feature has no API. It is based
on the gunzip tool. Thus, an executable file compressed
on the host system using the gzip command (whose suffix
is .gz) will be recognized automatically as a compressed
executable file or dynamic library and uncompressed by the system at load
time.
For details, see GZ_FILE(5FEA).
The DYNAMIC_LIB
feature provides support for
dynamic libraries within the ChorusOS operating system. These libraries are
loaded and mapped within the actor address space at execution time. Symbol
resolution is performed at library load time. This feature also enables a
running actor to ask for a library to be loaded and installed within its address
space, and then to resolve symbols within this library. The feature handles
dependencies between libraries.
The DYNAMIC_LIB feature API is summarized in the following table.
Function |
Description |
---|---|
dladdr() |
Translate address into symbolic information |
dlclose() |
Close a dynamic library |
dlerror() |
Get diagnostic information |
dlopen() |
Gain access to a dynamic library file |
dlsym() |
Get the address of a symbol in a dymanic library |
For details, see DYNAMIC_LIB(5FEA).
Shared libraries are similar to dynamic libraries. Dynamic libraries are shared if there is no relocation in the text section. To make a dynamic library sharable, you must compile all the objects belonging to the shared library with the FPIC = ON imake definition. The ChorusOS operating system also provides Imake rules to create shared libraries.
The API which applies to dynamic libraries also applies to shared libraries. The ChorusOS operating system provides the following shared libraries for user actors and processes:
Library |
Description |
---|---|
libc.so |
Basic library routines |
libnsl.so |
RPC library and network resolution routine (gethostbyname(), and so on) |
librpc.so |
RPC library only |
libpthread.so |
POSIX thread library |
libpam.so |
Password management routines |
Concurrent threads are synchronized by monitors. A monitor is a set of functions in which only one thread may execute at a time. It is possible for a thread running inside a monitor to suspend its execution so that another thread may enter the monitor. The initial thread waits for the second one to notify it (for example, that a resource is now available) and then to exit the monitor.
The MONITOR API is summarized in the following table:
Function |
Description |
---|---|
monitorGet() |
Obtains the lock on the given monitor |
monitorInit() |
Initializes the given monitor |
monitorNotify() |
Notifies one thread waiting in monitorWait() |
monitorNotifyAll() |
Notifies all threads waiting in monitorWait() |
monitorRel() |
Releases a lock on a given monitor |
monitorWait() |
Causes a thread that owns the lock on the given monitor to suspend itself until it receives notification from another thread |