Preventing stack guard-page hopping
Preventing stack guard-page hopping
Posted Jun 19, 2017 23:32 UTC (Mon) by excors (subscriber, #95769)In reply to: Preventing stack guard-page hopping by zblaxell
Parent article: Preventing stack guard-page hopping
> I've occasionally wondered what would happen if stacks were not accessible to other threads in the same process
I think that would break reasonable code like:
std::atomic_int n;
run_in_worker_threads_and_wait_for_them_all(iters, [&n] { n++; });
which passes a pointer to n (on the current thread's stack) to a bunch of worker threads (that probably weren't created by this thread).