LispBM
Loading...
Searching...
No Matches
LispBM
Author
LispBM project

http://www.lispbm.com

https://github.com/svenssonjoel/lispBM

Build LispBM

Building instructions: Building LispBM

Important for Integration

Thread Safety: It is very likely that an integration of LispBM will run on an RTOS and have multiple threads running in parallel with the LispBM evaluator. In such a situation external threads must pause the evaluator before calling most LispBM API functions.

The LispBM documentation marks functions with

Warning
Thread Requirement: This function MUST be called in the same thread as the evaluator OR the evaluator must be paused.

or with

Warning
Thread Requirement: This function MUST be called from the LBM evaluator thread only.

To highlight that they one needs to consider that these functions read or write data that can change at any time in the LispBM evaluation thread, unless paused.

Calling heap or environment functions from external threads without pausing causes undefined behavior and data corruption.

Example - Pausing the evaluator from an external thread:

sleep_callback(1000);
}
// Now safe to call LispBM functions
// ... your code here ...
void lbm_continue_eval(void)
Definition eval_cps.c:5922
uint32_t lbm_get_eval_state(void)
Definition eval_cps.c:5932
void lbm_pause_eval(void)
Definition eval_cps.c:5910
#define EVAL_CPS_STATE_PAUSED
Definition eval_cps.h:36

For example, most functions in lbm_c_interop.h require the evaluator to be paused.

Implementation documentation

Environment: env.h env.c
Evaluator: eval_cps.h eval_cps.c
Extensions: extensions.h extensions.c
Fundamental operations: fundamental.h fundamental.c
Heap: heap.h heap.c
Channels: lbm_channel.h lbm_channel.c
C interoperations: lbm_c_interop.h lbm_c_interop.c
Constants: lbm_constants.h lbm_constants.c
Custom types: lbm_custom_type.h lbm_custom_type.c
Global definitons: lbm_defines.h lbm_defines.c
Compactible memory region: lbm_defrag_mem.h lbm_defrag_mem.c
Flat values: lbm_flat_value.h lbm_flat_value.c
Arrays and boxed value memory: lbm_memory.h lbm_memory.c
Profiler: lbm_prof.h lbm_prof.c
Internal C types: lbm_types.h lbm_types.c
Utilities: lbm_utils.h lbm_utils.c
Version: lbm_version.h lbm_version.c
LispBM: lispbm.h lispbm.c
Printing values: print.h print.c
Stacks: stack.h stack.c
Symbol table: symrepr.h symrepr.c
Tokeniser: tokpar.h tokpar.c
Image: lbm_image.h lbm_image.c
Buffer: buffer.h buffer.c