[Prev][Next][Index][Thread]

Re: User context-switching!



On Tue, 9 Nov 1999, Johan Rydberg wrote:

>Christian Smith wrote:
>> 
>> As the context switching is user level, the kernel need not be involved.
>> The task (no pun intended) is rather simple. Simply save a few registers,
>> and switch stacks. Can use a similar mechanism as setjmp/longjmp.
>> 
>> Any registers can simply be pushed onto the stack. That way, the stack
>> contains the entire context of the task. As the context is all on the
>> stack, the stack switch is also the context switch.
>> 
>
>I know this, but isn't it a smart idea to implement a standard procedure
>to do this?
>
>Also implement routines to initialize a new context (a new thread).

Cool, if you're volunteering:)

If no-ones done this already, then by all means implement a new library.
There must be quite a few libraries about that implement this already, and
as the code is user level, it should not be hard to port to oskit.

A source of libraries can be found at:
http://www.linuxdoc.org/FAQ/Threads-FAQ/ThreadLibs.html

Some of the user libs provide a pthreads interface.

>
>-- 
>Johan Rydberg			johan.rydberg@netinsight.net
>Net Insight AB, Sweden		direct: +46-8-685 04 17
>http://www.netinsight.net	phone:  +46-8-685 04 00
>				fax:    +46-8-685 04 20
>
>


References: