concurrencythreadingownership

Arc when scoped threads would do

Wrapping borrowable data in Arc just to spawn a thread.

Why this looks tempting

Arc + spawn is the well-trodden path; scoped threads feel exotic.

Why wrong

Arc adds atomic refcount overhead and forces ownership transfer when a borrow is all you need. The data is local; the thread is local; the wrapper is overkill.

Fix

Use std::thread::scope — children may borrow from the parent's stack frame and the scope guarantees they finish before it returns. No Arc, no clone, no extra alloc.

Canonical alternative

concurrency/scoped-threads