Key POSIX program entities and Language Environment counterparts

POSIX defines four program model constructs:
Process
An address space, at least one thread of control that executes within that address space, and the thread's or threads' required system resources.

In general, POSIX processes are peers; they run asynchronously and are independent of one other, unless your application logic requests otherwise.

Some aspects of selected processes are hierarchical, however. A C process can create another C process (no ILC is allowed) by calling the fork() or spawn() functions. Certain function semantics are defined in terms of the parent process (the invoker of the fork) and the child process (cloned after the fork). For example, when a parent process issues a wait() or waitpid(), the parent process' logic is influenced by the status of the child process or processes.

A Language Environment process with a single enclave maps approximately to a POSIX process. In Language Environment, starting a main routine creates a new process. In POSIX, issuing a fork() or a spawn() creates a new process. A POSIX sigaction of stop, terminate, or continue applies to the entire POSIX process.

A Language Environment process with multiple enclaves is a Language Environment extension to POSIX. If a process contains more than one enclave, only the first enclave in the process can have POSIX(ON) specified. All of the nested enclaves must be POSIX(OFF). A process that contains any POSIX(OFF) enclaves cannot issue a fork() or a spawn(), either explicitly or implicitly (popen() being mapped to fork() and exec()).

Note: The scope of a specific POSIX function might be the Language Environment process or Language Environment enclave. See Scope of POSIX semantics for details.
Process group
Collection of processes. Group membership allows member processes to signal one another, and affects certain termination semantics.

No Language Environment entity maps directly to a POSIX process group.

Session
Collection of process groups. Conceptually, a session corresponds to a logon session at a terminal.

No Language Environment entity maps directly to a POSIX session, but a session is a rough equivalent of a Language Environment application whose execution scope is bounded by the end user logon and logoff.

Thread
A single flow of control within a process. Each thread has its own thread ID, state of any timers, errno value, thread-specific bindings, and the required system resources to support a flow of control. Threads are independent and not hierarchically related.

A Language Environment thread maps to a POSIX thread. POSIX pthread_create creates a new thread under Language Environment.

An enclave that contains multiple threads cannot issue fork(), either explicitly or implicitly (popen() being mapped to fork() and exec()).