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

Re: [Xen-devel] Mini-OS context switching


  • To: Julian Stecklina <der_julian@xxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
  • Date: Sun, 07 Oct 2007 14:55:11 +0100
  • Delivery-date: Sun, 07 Oct 2007 06:50:54 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcgI6a1s6+1Mb3TcEdyZ0QAWy6hiGQ==
  • Thread-topic: [Xen-devel] Mini-OS context switching

How is it more difficult than context-switching inside the timer interrupt?
In both cases you switch pt_regs and re-enable interrupts. Certainly I don't
think the more complicated way of enabling interrupts makes
context-switching in minios that much more complicated overall.

 -- Keir

On 7/10/07 00:37, "Julian Stecklina" <der_julian@xxxxxx> wrote:

> Hello,
> 
> I am currently trying to implement preemptive multithreading for Mini-OS
> and have the following problem:
> 
> If a context switch needs to occur outside of a timer interrupt, I fail
> to see how to implement it without race condition, because of the
> complex way to enable interrupts (clear memory word and perform a
> hypercall if upcalls are pending). The problem boils down to writing a
> function that takes the new register content as parameter, sets it and
> reenables interrupts. xen.h refers to a HYPERVISOR_stack_switch
> hypercall, which does not seem to be implemented or documented anywhere,
> though.
> 
> In contrast, context switching from an interrupt handler is easy, as it
> just involves changing the struct pt_regs.
> 
> Any help is greatly appreciated, as I am kind of clueless right now.
> 
> Regards,
> Julian
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.