Next: Threads in Embedded MzScheme
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 fields:
- error_buf --
This is the mz_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.
- config --
The thread's current parameterization. See also section 3.8.
- engine_weight --
The weight of the thread.
- next -- The next thread in the linked list of threads;
this is NULL for the main thread.
- error_escape_proc -- The current
error escape handler for this 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