Untested but what about: type X = ref object a: string var g: X proc foreign {.thread.} = var local = X(a: "abc") g = move local spawn foreign() # g now has an X Run
- Nim 2: "Memory can be shared effectively between threads with... zevv
- Nim 2: "Memory can be shared effectively between threads... Araq