Disk IO¶
The way disk async functions are implemented in lthread is by using a native
worker thread in the background to execute the actual read/write calls to disk.
When an lthread calls lthread_io_read()
or lthread_io_write()
a job is put on a queue for the native thread to pick up and the actual lthread
yields until the read/write is done.
Use lthread_io_read()
or lthread_io_write()
when
fd is a file descriptor to a file.
lthread_io_read¶
-
ssize_t
lthread_io_read
(int fd, void *buf, size_t nbytes)¶ An async version of read(2) for disk IO.