<div dir="ltr"><div><div><div>Hi,<br><br></div> I try to wrap inotify API. After adding a watcher, I try to read events from file descriptor. But the racket thread is blocking until the read operation is done. Here is the definition of read.<br>
<br>(define _read (get-ffi-obj &quot;read&quot; libc (_fun #:async-apply (lambda (f) (f))<br>                                             #:save-errno &#39;posix<br>                                            _fd_t<br>                                            (output : (_bytes o size))<br>
                                            (size : _uint32)<br>                                            -&gt; (r : _int32)<br>                                            -&gt; (values r saved-errno output))))<br></div>
<br></div><div>I am confused by the term callback. Is the callback called in the racket thread or another OS thread?<br><br></div><div>Thanks,<br>Haiwei<br></div></div>