User Threads - Memory Protection
Dear forum hello,
I'm currently writing a User-Level Thread Library.
The general idea is very simple:
I have a struct called Thread.
Each Thread contains relevant member fields as well as a stack at the end.
From the so-called Main Thread I malloc new Threads on the heap.
Now I want to protect these threads' memory.
Had I been using the kernel to create threads, I'd be getting SEG_FAULTS and all would've been good (well considering that you have a bug - you know about it, when it happens).
But I'm not!
How can I protect each thread's memory? How can I prevent its data being over-run by another thread in the same application?
10x in advanced,