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

Re: User context-switching!



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).

-- 
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

Follow-Ups: References: