Can thread stacks be built in privately mapped memory?
I’ve avoided any response to this long thread for a while because I’m not sure I want to confuse the issue with facts. And, despite, the facts, I like the idea of people learning to treat thread stacks “as if they might be” private. Nevertheless, at some time I thought it might be helpful to point out what POSIX says about the matter… and I guess this is a good time. POSIX very specifically disallows “non-shared” memory between threads. That is, it requires that the address space is associated with the PROCESS, not with the individual THREADS. All threads share a single virtual address space, and no memory address is private. Stacks, in particular, CANNOT be set up with private memory. Although, for safe programming, you should almost always pretend that it’s private. /—[ Dave Butenhof ]———————–[ butenhof@zko.dec.com ]—\ | Digital Equipment Corporation 110 Spit Brook Rd ZKO2-3/Q18 | | 603.881.2218, FAX 603.881.