<div dir="ltr">I've read sources and found new ideas.<div><br></div><div style>efile_drv.c is using driver_async: DRIVER_ASYNC(d->level, desc, d->invoke, void_ptr=d, d->free);</div><div style><br></div><div style>
desc is a pointer to file structure.</div><div style><br></div><div style>It means, that each request to one opened file descriptor will be executed on single async thread.</div><div style><br></div><div style><br></div><div style>
In fact, I need to make an erlang-level job queue for reading from disk. There is a long queue of disk requests. I can tag them by their "major device id" or any other tag.</div><div style><br></div><div style>I can track, how many requests are opened and not finished for one tag. If there is more than N/M requests (where N is async threads size and M is number of different tags), than request is queued or failed.</div>
<div style><br></div><div style>So, I think that I don't need to write it in C, I can do it in erlang, but make the back pressure not on C level, but on Erlang level.</div><div style><br></div></div>