4 ms·
What happens to objects shared between threads then?
by mojuba 5y ago
What happens to objects shared between threads then?
- elcritch 5y agoIt 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.
- winrid 5y agoIt 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.