How is context switch made in linux kernel when process exits before timer interrupt? I know that if the process is running and timer interrupt occurs then schedule function is called automatically if the flag is set, schedule function then selects next process to run. Basically in this case the schedule function runs in the context of current process but
Tag: ucontext
Segmentation fault with ucontext makecontext on OS X 10.10
I run my code in OS X 10.10 with gcc. I am trying to implement a usercontext library. If I comment out thread_create( &t2, thr2, NULL);, the code will produce desired effect. I have no idea why a line related to t2 will lead to segmentation fault of t1. Author’s Notes I happily work on implementing a usercontext library after