> This happens due to threading unfairness. There is another thread
> involved in making the writes, and it isn't able to acquire the
> async lock because of contention with the async scheduler. To
> explain this, here's what the
...
> If you watch what happens with print statements, you'll see the
> scheduler release the lock, call epoll, acquire the lock, and then
> see the I/O thread fail to acquire the lock. This happens over and
> over.
We talked at Jane Street some more about the problem with I/O threads
being unable to acquire the async lock, and are going to change
[In_thread.run] so that if it can't acquire the async lock, it
communicates to the scheduler via a [Thread_safe_queue] what needs to
be done. That should make async fairer to I/O in fully loaded
applications.
With that change, Sean's program shows output running it like:
ASYNC_CONFIG='((max_num_jobs_per_priority_per_cycle 5))'
And if one was willing to wait, one would even see output after 500s
with the default of 500.
The change should be publicly released in 109.56.