I know that Java uses a controlled mechanism to allow threads to be paused. If I understood correctly, they put a read from a protected page at the end of e.g. loops, and change the protection of that page if they want the thread to be paused.
What I don't understand is why this is necessary and whether this can even work. The only reason I can think of to make this necessary is that you don't have to have all pointers on the heap, and you can also just have them in registers. However, if you'd use the TSS, wouldn't you have the same data too?
However, what I find more interesting is how they handle system calls. What happens when the thread is doing a slow read of a file over e.g. a network? Does the GC way? Does the GC forgo a run and try again a moment later? What happens when the system call takes very long?