Professional Documents
Culture Documents
Chorus
Chorus
Chorus
Chorus
History of Chorus
Chorus started out at the French research institute INRIA in
1980, as a research project in distributed systems. It has
since gone through four versions, numbered from 0 through
3.
The idea behind Version 0 was to model distributed
applications as a collection of actors.
Version 1, which lasted from 1982 to 1984, focused on
multiprocessor research.
Version 2 (1984-1986) was a major rewrite of the system,
in C.
Version 3 was started in 1987. The version marked the
transition from a research system to a commercial product.
Goals of Chorus
1. High-performance UNIX emulation.
2. Use on distributed systems.
3. Real-time applications.
4. Integrating object-oriented programming
into Chorus.
System Structure
UNIX subsystem Object-oriented subsystem
u1 u2 u3 User process
User
addr.
s1 s2 s3 System process
space
Region of address
Port: holding incoming
space
messages at any instant,
each port belongs to one
process.
network
A capability in Chorus
UI of a port key to distinguish objects
Bits 13 3 48 64
Creation Type Epoch number Defined by the
site + counter subsystem
Unmapped address
Mapped portion of file F
Region file
Unmapped portion of file
Unmapped address F
Copy of program’s initial
Region data data
Read-only segment
Region program
Kernel structure
Responsible for ports and messages
Interprocess communication
manager (portable) Manages paging
(low-level part of
Handles, processes, the paging system)
threads, and Real-time executive Virtual memory
scheduling (portable) (portable)
Machine-dependent
Supervisor (machine dependent) Portion of the
Caches traps, virtual
interrupts, and exceptions Memory manager
The UNIX Subsystem
Since Chorus is now a commercial product, it must be
compatible with UNIX. Chorus accomplishes this goal by
providing a standard subsystem, called MiX, that is
compatible with System V.
MiX is also compatible with UNIX in other ways. For
example, the file system is compatible, so Chorus can
read a UNIX disk. Furthermore, the Chorus device drivers
are interface compatible with the UNIX ones, so if UNIX
device drivers exist for a device machine, they can be
ported to Chorus with relatively littler work.
The Object-Oriented Subsytem
It consists of three layers. The bottom layer
does object management in a generic way
and is effectively a microkernel for object-
oriented systems. The middle layer
provides a general runtime system. The top
layer is the language runtime system. This
subsystem, called COOL.
Process Management in Chorus
A process in Chorus is a collection of
active and passive elements that work
together to perform some computation. The
active elements are the threads. The
passive elements are an address space
(containing some regions) and a collection
of ports (for sending and receiving
messages).
Three kinds of processes
Type Trust Privilege Mode Space
A
These threads
are not
timesliced B
These threads D
C D C D C
are timesliced
Low priority
Traps, Exceptions, and Interrupts
Traps are intentional calls to the kernel or a
subsystem to invoke services. Programs cause traps
by calling a system call library procedure. The
system supports two ways of handling traps.
1. all traps for a particular trap vector go to a single
kernel thread that has previously announced its
willingness to handle that vector.
2. each trap vector is tied to an array of kernel threads,
with the Chorus supervisor using the contents of a
certain register to index into the array to pick a
thread.
Exceptions are unexpected events that are
caused by accident, such as the divide-by-
zero exception, floating-point overflow, or
a page fault.
Interrupts are caused by asynchronous
events, such as clock ticks or the
completion of an I/O request.
Kernel Calls for Process
Management
actorCreate Create a new process
ActorDelete Remove a process
ActorStop Stop a process, put its threads in
STOPPED state
actoreStart Restart a process from STOPPED state
actorPriority Get or set a process’ priority
actorExcept Get or set the port used for exception
handling
threadCreate Create a new thread
threadDelete Delete a thread
threadSuspend Suspend a thread
S1
S2
Distributed Shared Memory
Chorus supports paged distributed shard memory in
the style of IVY. IT uses a dynamic decentralized
algorithm, meaning that different managers keep
track of different pages, and the manager for a page
change as the page moves around the system.
The unit of sharing between multiple machines is the
segment. Segments are split up into fragments of one
or more pages. At any instant, each fragment is either
read-only, and potentially present on multiple
machines, or read/write, and present only on one
machine.
Kernel Calls for Memory
Management
rgnAllocate Allocate a memory region and set its properties
network
Communication Operations
Two kinds of communication operations are
provided by Chorus: asynchronous send and
RPC.
Asynchronous send allows a thread simply to
send a message to a port. There is no guarantee
that the message arrives and no notification if
something goes wrong.
RPC uses blocking send and at-most-once
semantics.
To all
1 2 3
To any
1 2 3
To 1
1 2 3
Not to 1
1 2 3
Kernel calls for communication
portCreate Create a port and return its capability