Slug: design-sched-01 · Paired reading: Chapter 27
Prompt
fn spawn_job<F>(f: F) -> JoinHandle<()> where
F: FnOnce() + Send + 'static — thread::spawn wrapper. Document why
Send + 'static: the closure may outlive the caller and run elsewhere.
The curriculum, drills, tutor, and interviewer mode are for readers of Ace the Rust Interview. The code is printed in the Preface (Companion site access).
Don’t have the book yet? Get it on Amazon (US and other storefronts linked in the site footer) — the Preface access code unlocks this gym.
advanced · order 173
Slug: design-sched-01 · Paired reading: Chapter 27
fn spawn_job<F>(f: F) -> JoinHandle<()> where
F: FnOnce() + Send + 'static — thread::spawn wrapper. Document why
Send + 'static: the closure may outlive the caller and run elsewhere.