Functions | |
int | embryo_program_recursion_get (Embryo_Program *ep) |
Returns the number of virtual machines are running for the given program. | |
int | embryo_program_run (Embryo_Program *ep, Embryo_Function fn) |
Runs the given function of the given Embryo program in the current virtual machine. | |
Embryo_Cell | embryo_program_return_value_get (Embryo_Program *ep) |
Retreives the return value of the last called function of the given program. | |
void | embryo_program_max_cycle_run_set (Embryo_Program *ep, int max) |
Sets the maximum number of abstract machine cycles any given program run can execute before being put to sleep and returning. | |
int | embryo_program_max_cycle_run_get (Embryo_Program *ep) |
Retreives the maximum number of abstract machine cycles a program is allowed to run. |
|
Retreives the maximum number of abstract machine cycles a program is allowed to run.
|
|
Sets the maximum number of abstract machine cycles any given program run can execute before being put to sleep and returning.
It is important to note that abstract machine cycles are NOT the same as the host machine cpu cycles. They are not fixed in runtime per cycle, so this is more of a helper tool than a way to HARD-FORCE a script to only run for a specific period of time. If the cycle count is set to something low like 5000 or 1000, then every 1000 (or 5000) cycles control will be returned to the calling process where it can check a timer to see if a physical runtime limit has been elapsed and then abort runing further assuming a "runaway script" or keep continuing the script run. This limits resolution to only that many cycles which do not take a determined amount of time to execute, as this varies from cpu to cpu and also depends on how loaded the system is. Making the max cycle run too low will impact performance requiring the abstract machine to do setup and teardown cycles too often comapred to cycles actually executed. Also note it does NOT include nested abstract machines. IF this abstract machine run calls embryo script that calls a native function that in turn calls more embryo script, then the 2nd (and so on) levels are not included in this run count. They can set their own max instruction count values separately. The default max cycle run value is 0 in any program until set with this function. |
|
Returns the number of virtual machines are running for the given program.
|
|
Retreives the return value of the last called function of the given program.
|
|
Runs the given function of the given Embryo program in the current virtual machine.
The parameter
|