When I'm just curious about the implementation details, I read the C code. And as I can tell, it's safe after moving, as `local` is then set to `nil` (, which is the side effect of moving.) But the operation of moving can be unsafe, as it's unknown if `move` is an atomic operation. You may need a `Lock` to prevent the main thread from accessing `g` during the move. var g: X proc foreign {.thread.} = var local = X(a: "abc") {.cast(gcsafe).}: g = move local # local is now `nil` # local is about to be destoryed, but it's now `nil`. No operation. # g destroyed. Run
- Nim 2: "Memory can be shared effectively between threads wit... zevv
- Nim 2: "Memory can be shared effectively between thread... Araq
- Nim 2: "Memory can be shared effectively between th... PMunch
- Nim 2: "Memory can be shared effectively betwee... Araq
- Nim 2: "Memory can be shared effectively be... PMunch
- Nim 2: "Memory can be shared effective... sls1005
- Nim 2: "Memory can be shared effec... giaco
- Nim 2: "Memory can be shared e... Araq
- Nim 2: "Memory can be shared e... zevv
- Nim 2: "Memory can be shared e... zevv
- Nim 2: "Memory can be shared e... Araq
- Nim 2: "Memory can be shared e... zevv
- Nim 2: "Memory can be shared e... planetis
- Nim 2: "Memory can be shared e... planetis
- Nim 2: "Memory can be shared e... Araq
- Nim 2: "Memory can be shared e... PMunch