PreviousUpNext

14.4.29  Hostthread

The standard library Hostthread api defines access to runtime functionality allowing Mythryl-level access to Posix threads). Since in general multiple kernel threads run on multiple cores on modern multicore chips, this potentially provides processing speedups via parallel computation.

The Hostthread api is implemented by the hostthread package.

The Hostthread api source code is in src/lib/std/src/hostthread.api.

The above information is manually maintained and may contain errors.

api {
    Hostthread;
    Barrier;
    Condvar;
    Mutex;
    Try_Mutex_Result  = ACQUIRED_MUTEX | MUTEX_WAS_UNAVAILABLE;
    exception MAKE_PTRHEAD;
    get_hostthread_ptid : Void -> one_word_unt::Unt;
    get_cpu_core_count : Void -> Int;
    get_hostthread : Void -> Hostthread;
    get_hostthread_name : Hostthread -> String;
    set_hostthread_name : String -> Void;
    hostthread_to_int : Hostthread -> Int;
    spawn_hostthread : (Void -> Void) -> Hostthread;
    join_hostthread : Hostthread -> Void;
    signal_hostthread : (Hostthread , Int) -> Void;
    hostthread_exit : Void -> X;
    make_mutex : Void -> Mutex;
    free_mutex : Mutex -> Void;
    acquire_mutex : Mutex -> Void;
    release_mutex : Mutex -> Void;
    try_mutex : Mutex -> Try_Mutex_Result;
    with_mutex_do : Mutex -> (Void -> X) -> X;
    make_condvar : Void -> Condvar;
    free_condvar : Condvar -> Void;
    wait_on_condvar : (Condvar , Mutex) -> Void;
    signal_condvar : Condvar -> Void;
    broadcast_condvar : Condvar -> Void;
    make_barrier : Void -> Barrier;
    free_barrier : Barrier -> Void;
    set_barrier : {barrier:Barrier, threads:Int} -> Void;
    wait_on_barrier : Barrier -> Bool;
    mutex_to_int : Mutex -> Int;};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext