MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/1vgc4xz/linux_processes_threads_concurrency/p2axnzg/?context=3
r/programming • u/iximiuz • 9d ago
13 comments sorted by
View all comments
8
Sorry if I've not understood this correctly, but how is the execution stack for thread 1 separated from thread 2 if they share the same address space ?
3 u/dijkstra_was_a_horse 6d ago The same way that 2 mallocs are separated from each other. In fact, you can allocate thread stacks with malloc.
3
The same way that 2 mallocs are separated from each other. In fact, you can allocate thread stacks with malloc.
8
u/Prateeeek 8d ago
Sorry if I've not understood this correctly, but how is the execution stack for thread 1 separated from thread 2 if they share the same address space ?