# Make block_with_timeout more robust \(\#11670\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/c73d6502d6199ba5d9ddc2b9986fb88f4eee6c92)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: c73d6502d6199ba5d9ddc2b9986fb88f4eee6c92

Requested commit: c73d6502d6199ba5d9ddc2b9986fb88f4eee6c92

Commit: c73d6502d6199ba5d9ddc2b9986fb88f4eee6c92

Tree: 1ba033e2f79c8830c9b21b849c6688016577ae99

Author: Conrad Irwin

Committer: GitHub

## Message

```
Make block_with_timeout more robust (#11670)

The previous implementation relied on a background thread to wake up the
main thread,
which was prone to priority inversion under heavy load.

In a synthetic test, where we spawn 200 git processes while doing a 5ms
timeout, the old version blocked for 5-80ms, the new version blocks for
5.1-5.4ms.

Release Notes:

- Improved responsiveness of the main thread under high system load
```

## Parents

- [b34ab6f3a1c107e3d5e4136bea12d3e910bcd95b](https://git.cafe/gitcafe/zed/commit/b34ab6f3a1c107e3d5e4136bea12d3e910bcd95b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/c73d6502d6199ba5d9ddc2b9986fb88f4eee6c92?format=markdown)
