Rust concurrency patterns: condvars and locks

https://fetch.spec.whatwg.org/#preface
  1. Fetch 1 has checked the cache, found nothing, and started a networking request for the resource.
  2. Fetch 1 has not received headers from the network, hence hasn’t put a “pending resource” in the cache yet.
  3. Fetch 2 checks the cache for the same key as the one used by fetch 1, finds nothing, and goes the network as well.
  4. Fetch 1 receives headers, puts a pending resource in the cache. It’s too late, fetch 2 already went to the network.
https://github.com/servo/servo/pull/24318/files#diff-aa469beb5619907dbccd88364264b9b8R66

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gregory Terzian

Gregory Terzian

535 Followers

Software engineer living in Shanghai. I write in Javascript, Python, Rust, and English. Always for people to read. https://github.com/gterzian