unique ownership + unlimited safe generational references

Nick Treleaven nick at geany.org
Wed Mar 30 11:23:37 UTC 2022


On Wednesday, 30 March 2022 at 07:02:16 UTC, Ola Fosheim Grøstad 
wrote:
> How does this work with multithreaded shared references?

Vale doesn't allow sharing mutable data across threads. But if 
the assumption that most programs alias data (copying a pointer) 
more often than they access the data is correct, it seems 
thread-safe generational references would still be faster (at 
least naive RC vs naive GR). The cost of mutual-exclusion would 
be paid on any dereference check but there would be no cost on 
aliasing. (Also multiple dereferences of the same data may only 
need one check in some cases).


More information about the Digitalmars-d mailing list