The ChorusOS operating system offers a POSIX API for process management. POSIX comprises a set of standard APIs for portable multithreaded programming. The ChorusOS operating system provides the following POSIX APIs:
POSIX (1003.1) message queue (POSIX-MQ)
POSIX (1003.1) semaphores (POSIX-SEM)
POSIX (1003.1) shared memory objects (POSIX-SHM)
POSIX (1003.1) real-time clock/timers (POSIX-TIMERS)
POSIX (1003.1) pthreads (POSIX-THREADS)
POSIX (1003.1) compatible I/O system calls (POSIX-FILEIO)
POSIX (1003.1) compatible socket system calls (POSIX-SOCKETS)
POSIX (1003.1) real-time signals (POSIX_REALTIME_SIGNALS)
The processes also benefit from the dynamic libraries (DYNAMIC_LIB) and compressed (GZ_FILE) features. Processes can be multi-threaded using the POSIX pthread calls described below. However, the ChorusOS operating system has some limitations regarding multi-threaded processes. It is not possible to invoke either fork() or exec() from a multi-threaded process. Such attempts will fail and report an error code. If a multi-threaded application needs to launch a process, it should use the posix_spawn() system call. However, the ChorusOS implementation of the posix_spawn() call is limited and does not permit handling of file or signal management operations.
Process images in the ChorusOS operating system are loaded from their files and are not mapped in memory, even though the underlying selected memory profile supports paging.
You can set tunable values for the following when you build your system:
The maximum number of processes that can be created on a system. This value is lower than the maximum number of actors that can be created, which is also set when you build your system.
The maximum number of threads that can be created on a system.
The maximum number of threads that can be created inside a process.
POSIX processes are divided into two types, user and supervisor processes. The main differences between user and supervisor processes are outlined below:
Supervisor processes run in the same address space as the system. User processes run in their own private address space so that if they attempt to reference a memory address that is not valid in their address space, they encounter a fault and, by default, are deleted.
Supervisor processes run in privileged mode. This is architecture-specific, and means that certain privileged instructions are available to supervisor processes which are not available to user-mode applications.
User applications must trap into the system, whereas supervisor applications do not since they operate in privileged mode.
Supervisor applications have only one stack (the system stack), whereas user applications have one stack in user mode and another stack to execute when they trap into privileged mode.
Some libraries are different between supervisor applications and user applications, since supervisor applications can execute privileged instructions, and user applications trap to access system services.