Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wonder if you could just pass this 10000 tree node root to another thread that will just drop it.

This should result in no pause for main thread.

Apparently you need Arc for that not Rc which shouldn't have much overhead over Rc in reasonable scenarios.



Yes, that is how C++/WinRT handles cascading deletion of COM instances, however when you are going down that route, it is basically a poor man's tracing GC.


However it just for the stuff you need it for. It's not all encompassing. It's not mandatory part of the language.


True, and unfortunately a reason why we keep having CVEs related to memory corruption.


There is a thread I came across on hacker news that does exactly that https://news.ycombinator.com/item?id=23362518 - this question reminded me of it


Yes, doing big drops in a subthread is a good way of avoiding pauses when dropping large objects of any kind.


Which is, of course, largely what concurrent GC is about.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: