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

Even if everything is immutable, sharing data between threads adds memory management overhead that isn't worth it for most objects. For GC, you have to walk the environment of every thread to free anything in the shared memory. I dunno how big of a difference that makes for fancy concurrent GCs, but for regular ones, you'd have to stop every thread during collection. For reference counting, it's a bit simpler; so long as each thread keeps its own reference count, you can decouple the reference counting from freeing and have a hybrid scheme where you "GC" the shared object heap by scanning for objects with reference counts of 0 in all threads. Still not free, though.


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

Search: