Re:Friendship ended with the garbage collector
by mojuba on Friday August 27, 2021 @03:25AM
(#28325216)
What happens to objects shared between threads then?
[ Parent
| on HN ]
Re:Friendship ended with the garbage collector
by elcritch on Friday August 27, 2021 @03:54AM
(#28325351)
It depends on the GC you're using with Nim. Guessing the OP means the newer ARC GC, then you can use `move` semantics to move some data to another thread, or you can do a deepCopy. You can do shared data structures but that requires a bit more work.
Re:Friendship ended with the garbage collector
by winrid on Friday August 27, 2021 @06:32PM
(#28333661)
It becomes more difficult. There are a few supported memory managers by Nim (including Go's GC!), but with ARC you explicitly move or deep copy the structure.
Obviously this is a bit more difficult than say Java, but then you never have to stop the world.