4 ms·
IIRC it is just having locks with exclusive constructors, which take previous locks’ guards (by ownership?). That way you can never lock lock B if you have not
by diarrhea 2y ago
IIRC it is just having locks with exclusive constructors, which take previous locks’ guards (by ownership?).
That way you can never lock lock B if you have not received a guard aka lock from lock A prior. Ensured on the type level.
I suppose doing this at scale is a real challenge.
- jelder 2y agoThe general term for this is "Session types." The Par crate is probably the most mature attempt at this to date. https://github.com/faiface/par https://github.com/faiface/par