
Next: Environment Configuration
Up: MzScheme Architecture
Previous: Library Functions
The intializer function scheme_basic_env creates the main
Scheme thread; all other threads are created through calls to
scheme_thread.
Information about each internal MzScheme thread is kept in a
Scheme_Process structure. A pointer to the current thread's
structure is available as scheme_current_process.
A Scheme_Process
structure includes the following items:
- error_buf --
This is the jmp_buf value used to
escape from errors. The error_buf value of the current thread
is available as scheme_error_buf.
- jumping_to_continuation --
This flag distinguishes
escaping-continuation invocations from error escapes. The
jumping_to_continuation value of the current thread
is available as scheme_jumping_to_continuation.
- env --
This is the global environment for the thread.
The env value of the current thread is available as scheme_env.
- config --
This is a shortcut to env's configuration record (see below).
- in_port, out_port, and err_port --
These are the thread's original input and output ports.
- write_port, read_port, and readerr_port --
The are pipes into/out of the thread's original input and output ports.
These values are NULL for the main thread.
- engine_weight --
The weight of the thread.
- exn_handler -- The current
exception handler for this thread.
- next -- The next thread in the linked list of threads;
this is NULL for the main thread.
The list of all threads is kept in a linked list;
scheme_first_process points to the first thread in the list.
The last thread in the list is always the main thread.
PLT