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

About :: TODO :: Blog :: RSS :: Old blog :: Projects :: GIT :: Gallery :: Notes

Mon, 22 Jan 2007

Signals and contexts.


I was a bit optimistic when said that scheduling works - it can not work at all, completely, since it is not allowed to call setcontext()/swapcontext() from signal handler. It is only needed to schedule away CPU-bound tasks which do not perform syscalls, since syscall will be a rescheduling point too.

To solve this situation system needs to either spawn additional control thread, or allow kernel to create different signal types, which will be safe for setcontext()/swapcontext(). The former is platform-independent approach, although I would like to implement the latter, but for now first one will be done.

I've just found that there is no preemptive userspace threading library - IBM's closed NGPT library is based on GNU Pth and they both proide only non-preemptive scheduling.

Now I understand why I have so much problems with preemptive scheduling, and actually it does not look like there is easy solution even with control thread - all *context() functions work only with current context.

This requires some deep thinking...

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

Please solve this captcha to be allowed to post (need to reload in a minute): 74 - 38

Comments are closed for this story.