5 ms·
> non lock, non atomics based ARC designs that still handle threading safely Don't think that's even doable at all, at least not portably. Do you have some exa
by m0zg 5y ago
> non lock, non atomics based ARC designs that still handle threading safely
Don't think that's even doable at all, at least not portably. Do you have some examples?
- elcritch 5y agoThere's a couple of methods like deferred counting, differential counting, or biased references. They're usually not completely atomic free but generally provide guaranteed constant overhead or tweak when or how the memory can be shared. - Nim's ARC only allows one thread to manage a reference count at a time, but enables an isolated graph of memory to be moved to another thread. The concept is called `Isolate`, and is very similar to Rust's single owner of mutable references. There's still WIP to have the compiler automate the checks, but it's usable now (I used it with FreeRTOS's xQueue mechanism just fine). https://github.com/nim-lang/RFCs/issues/244 https://github.com/nim-lang/RFCs/issues/244 - Python's new non-GIL proposal that does this using biased references: https://hackaday.com/2021/11/03/python-ditches-the-gils-and-comes-ashore/ https://hackaday.com/2021/11/03/python-ditches-the-gils-and-... - The source of Python's biased references: https://iacoma.cs.uiuc.edu/iacoma-papers/pact18.pdf https://iacoma.cs.uiuc.edu/iacoma-papers/pact18.pdf - Defered Reference counting: https://dl.acm.org/doi/pdf/10.1145/3453483.3454060 https://dl.acm.org/doi/pdf/10.1145/3453483.3454060 It's pretty cool stuff!
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]