scheduler.h
Include dependency graph for scheduler.h:
This graph shows which files directly or indirectly include scheduler.h:
Scheduling functions.
Scheduling functions are used to schedule processes.
Defines
-
DEFAULT_REDUCTIONS_AMOUNT 1024
Functions
-
Context *scheduler_run(GlobalContext *global)
run the scheduler and return a process to be executed.
- Parameters:
global – the global context.
-
Context *scheduler_wait(Context *c)
move a process to waiting queue and wait a ready one
move current process to the waiting queue, and schedule the next one or sleep until an event is received.
- Parameters:
c – the process context.
-
void scheduler_init_ready(Context *c)
Init a process in the ready state, moving it to the scheduler queue.
- Parameters:
c – the process context.
-
void scheduler_signal_message(Context *c)
Signal a process that a message was inserted in the mailbox.
Cannot be called from a foreign task or from ISR.
- Parameters:
c – the process context.
-
void scheduler_signal_message_from_task(Context *c)
Signal a process that a message was inserted in the mailbox.
Must only be called while global->processes_spinlock is acquired.
- Parameters:
c – the process context.
-
void scheduler_kill(Context *ctx)
Signal a process that it was killed.
- Parameters:
ctx – the process context.
-
void scheduler_terminate(Context *c)
removes a process and terminates it from the scheduling queue
removes a process from the scheduling ready queue and destroys it if its not a leader process.
- Parameters:
c – the process that is going to be terminated.
-
void scheduler_stop_all(GlobalContext *global)
Terminate all schedulers. Every process is terminated gracefully at next scheduling point.
- Parameters:
global – the global context.
-
Context *scheduler_next(GlobalContext *global, Context *c)
gets next runnable process from the ready queue.
gets next runnable process from the ready queue, it may return current process if there isn’t any other runnable process.
- Parameters:
global – the global context.
c – the current process.
- Returns:
runnable process.
-
void scheduler_set_timeout(Context *ctx, avm_int64_t timeout)
sets context timeout
set context timeout timestamp, move context to wait queue and update global next timeout timestamp.
- Parameters:
ctx – the context that will be put on sleep
timeout – amount of time to be waited in milliseconds.
-
int scheduler_entry_point(GlobalContext *glb)
Entry point for schedulers.
- Parameters:
glb – the global context.