Bug in sleep() function - main thread work affecting sleep duration on running tasks

Update

Potentially, the following PR might be the answer to the bug report generated by the current topic.

This is slightly speculative, but it fixes #50643 which is a start. But it hasn’t been tested under heavy contention of the uv lock.
It also currently uses the normal mutex but we probably need to switch to a lock that has some form of fairness (maybe #50878 )

Remove in threaded region and add a thread that runs the UV loop by gbaraldi · Pull Request #50880 · JuliaLang/julia (github.com)

I didn’t have time to test if the above PR changes things - but I’ll do that soon and leave an update here.

Also, here is a (new) related topic that touches the issue raised by the current topic.

3 Likes