简体   繁体   中英

Can I create a Thread with its stack at a specific address?

I am experimenting a little and wondered whether it would be possible to create a thread with its stack at a specific address which I would supply, or at least let thread stacks only spawn within some (huge) virtual memory region I can specify.

The reason I am interested in this is that I'd like to copy the whole stack over to a remote process at some point and need pointers to stay intact, and for thread stacks to not collide.

It might not be the best/safest way of doing that, I know, but it's just a little hobby project. If you know how to do this on Linux, I'm interested in that too.

Just compiling what the comments said.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM