PreviousUpNext

14.4.53  Microthread_Preemptive_Scheduler

The standard library Microthread_Preemptive_Scheduler api defines the scheduling queues and preemption mechanisms for microthreaded Mythryl programs.

The Microthread_Thread_Scheduler api is implemented by the microthread_preemptive_scheduler package.

The Microthread_Thread_Scheduler api source code is in src/lib/src/lib/thread-kit/src/core-thread-kit/microthread-preemptive-scheduler.api.

See also: Thread_Scheduler_Control api.

The above information is manually maintained and may contain errors.

api {
    foreground_run_queue : rw_queue::Rw_Queue(((Microthread , fate::Fate(Void ))) );
    background_run_queue : rw_queue::Rw_Queue(((Microthread , fate::Fate(Void ))) );
    set_condvar__iu : ?.internal_threadkit_types::Condition_Variable -> Void;
    get_current_microthread : Void -> Microthread;
    set_current_microthread : Microthread -> Void;
    push_into_run_queue : (Microthread , fate::Fate(Void )) -> Void;
        enqueue_old_thread_plus_old_fate_then_install_new_thread :
        {new_thread:Microthread, old_fate:fate::Fate(Void )} -> Void;
    assert_not_in_uninterruptible_scope : String -> Void;
    enter_uninterruptible_scope : Void -> Void;
    exit_uninterruptible_scope : Void -> Void;
    dispatch_next_thread__xu__noreturn : Void -> X;
    dispatch_next_thread__noreturn : Void -> X;
    switch_to_thread__xu : (Microthread , fate::Fate(X ) , X) -> Void;
    yield_to_next_thread__xu : fate::Fate(Void ) -> X;
    run_next_runnable_thread__xu__hook : Ref(fate::Fate(Void ) );
    no_runnable_threads_left__hook : Ref(fate::Fate(Void ) );
    thread_scheduler_shutdown_hook : Ref(fate::Fate(((Bool , Int)) ) );
    get_approximate_time : Void -> time::Time;
    reset_thread_scheduler : Bool -> Void;
    start_thread_scheduler_timer : time::Time -> Void;
    stop_thread_scheduler_timer : Void -> Void;
    restart_thread_scheduler_timer : Void -> Void;
    block_until_inter_hostthread_request_queue_is_nonempty : Void -> Void;
    Do_Echo  = {reply:String -> Void, what:String};
    echo : Do_Echo -> Void;
    do : (Void -> Void) -> Void;
    run_thunk : (Void -> Void) -> Void;
    run_thunks : List((Void -> Void) ) -> Void;
    run_thunk_soon : (Void -> Void) -> Void;
    run_thunk_immediately__iu : (Void -> Void) -> Void;
    inter_hostthread_request_queue_is_empty : Void -> Bool;
    trace_backpatchfn : Ref(((Void -> String) -> Void) );
    get_uninterruptible_scope_nesting_depth : Void -> Int;
    uninterruptible_scope_mutex : Ref(Int );
    alarm_handler_calls : Ref(Int );
    alarm_handler_calls_with__uninterruptible_scope_mutex__set : Ref(Int );
    alarm_handler_calls_with__microthread_switch_lock__set : Ref(Int );
    wake_scheduler_hostthread_if_paused : Void -> Void;
    kill_count : Ref(Int );
    thread_scheduler_statestring : Void -> String;
    print_thread_scheduler_state : Void -> Void;
    print_int : Int -> Int -> Void;
    mutex : hostthread::Mutex;
    condvar : hostthread::Mutex;
    Request  = DO_ECHO Do_Echo | DO_THUNK Void -> Void;
    request_queue : Ref(List(Request ) );};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext