python-on-a-chip online compiler

Dependencies:   mbed TSI

Embed: (wiki syntax)

« Back to documentation index

interp.c File Reference

interp.c File Reference

VM Interpreter. More...

Go to the source code of this file.

Functions

PmReturn_t interpret (const uint8_t returnOnNoThreads)
 Interprets the available threads.
PmReturn_t interp_reschedule (void)
 Selects a thread to run and changes the VM internal variables to let the switch-loop execute the chosen one in the next iteration.
PmReturn_t interp_addThread (pPmFunc_t pfunc)
 Creates a thread object and adds it to the queue of threads to be executed while interpret() is running.
void interp_setRescheduleFlag (uint8_t boolean)
 Sets the reschedule flag.

Detailed Description

VM Interpreter.

VM interpreter operations.

Definition in file interp.c.


Function Documentation

PmReturn_t interp_addThread ( pPmFunc_t  pfunc )

Creates a thread object and adds it to the queue of threads to be executed while interpret() is running.

The given obj may be a function, module, or class. Creates a frame for the given function.

Parameters:
pfuncPtr to function to be executed as a thread.
Returns:
Return status

Definition at line 2314 of file interp.c.

PmReturn_t interp_reschedule ( void   )

Selects a thread to run and changes the VM internal variables to let the switch-loop execute the chosen one in the next iteration.

For the moment the algorithm is primitive and will change the thread each time it is called in a round-robin fashion.

Definition at line 2282 of file interp.c.

void interp_setRescheduleFlag ( uint8_t  boolean )

Sets the reschedule flag.

Parameters:
booleanReschedule on next occasion if boolean is true; clear the flag otherwise.

Definition at line 2343 of file interp.c.

PmReturn_t interpret ( const uint8_t  returnOnNoThreads )

Interprets the available threads.

Does not return.

Parameters:
returnOnNoThreadsLoop forever if 0, exit with status if no more threads left.
Returns:
Return status if called with returnOnNoThreads != 0, will not return otherwise.

Definition at line 25 of file interp.c.