Zbr's days.
January
Sun Mon Tue Wed Thu Fri Sat
 
27
     
2007
Months
Jan

About TODO Blog RSS Old blog Projects Gallery Notes

Sat, 27 Jan 2007

New userspce preemptive scheduler for M-on-N threading model is completed.


It was built on the idea, that kernel saves in stack information about interrupted context, so it can be extracted there and changed to anything else. I do not use makecontext() and friends at all now, since its internals are completely different from what is stored in signal's stack. System works, but not 100% reliable - there is a race in scheduler when it is possible to reference a thread which was just exited, I will fix this with introduction of atomic operations, which will also reduce thread creation overhead related to futex() syscall, which is how semapphores are implemented, which are currently main locks in my threading library.

Such approach currently can only be used, when sources are compiled without position-independent code support.

If timer signal based scheduler is disabled, no bugs happens (which is quite obvous, since it becomes synchronous).

I did not tested SMP scalability and there is no syscall dynamic substitution, which will be added after I complete bug fixing in the scheduler.

Current test for speed of the thread creation shows (thread is allocated, its empty function is called, then it is removed), that speed for one thread creation/execution/destruction is about 1.9 microseconds, compared to 14 microseconds for NPTL POSIX threads.

/devel/threading :: Link / Comments (0)

Please solve this captcha to be allowed to post (need to reload in a minute): 81 * 48

Comments are closed for this story.