PreviousUpNext

14.4.33  Io_Wait_Pthread

The standard library Io_Wait_Pthread api defines the interface for a dedicated pthread which essentially sits in a loop doing C select() on the currently interesting set of file descriptors, pipe descriptors and socket descriptors. The primary purpose is to offload blocking I/O from the main threadkit pthread, allowing it to run full speed. (A secondary purpose is to generate a timeslicing clock for threadkit via the select() timeout.)

The Io_Wait_Pthread api is implemented by the io_wait_pthread package.

The Io_Wait_Pthread api source code is in src/lib/std/src/pthread/io-wait-pthread.api.

The above information is manually maintained and may contain errors.

api {
    is_running : Void -> Bool;
    start : String -> Bool;
    Do_Stop  = {reply:Void -> Void,  who:String};
    stop : Do_Stop -> Void;
    Do_Echo  = {reply:String -> Void,  what:String};
    echo : Do_Echo -> Void;
    Do_Note_Iod_Reader  =
      {io_descriptor:Int,  read_fn:Int -> Void};
    note_iod_reader : Do_Note_Iod_Reader -> Void;
    drop_iod_reader : Int -> Void;
    Do_Note_Iod_Writer  =
      {io_descriptor:Int,  write_fn:Int -> Void};
    note_iod_writer : Do_Note_Iod_Writer -> Void;
    drop_iod_writer : Int -> Void;
    Do_Note_Iod_Oobder  =
      {io_descriptor:Int,  oobd_fn:Int -> Void};
    note_iod_oobder : Do_Note_Iod_Oobder -> Void;
    drop_iod_oobder : Int -> Void;
    get_timeout_interval : Void -> time::Time;
    set_timeout_interval : time::Time -> Void;
    drop_per_loop_fn : Ref((Void -> Void) ) -> Void;
    note_per_loop_fn : Ref((Void -> Void) ) -> Void;
};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext