Re: own stackframe -> prob with exception handling



Jochen Kalmbach [MVP] schrieb:
Hi olk!

I've some code which creates its own stackframe and does some kine of context switching (using inline assembler).

Why not switch the whole stack?

The code works similiar to ucotnext -> makecontext()/swapcontext() etc.
What it doesis: it creates an stack on an range in the memory. It saves the registers. Such context objects can bes sappwed. So it does swap the whole stack (assigned to it).

Or: Why not use CreateFiber? and SwitchToFiber?
Has some problems. for instance you can not move fibers between threads. You have the ugly ConvertThreadToFiber()/ConvertFiberToThread() stuff etc.

I need to know how to get the surounding exception handler recognized.
.



Relevant Pages

  • Re: context switching
    ... > I wonder why is context switching operation is considered to be heavy? ... Every process created has its own stack space. ... processes running and OS wants to do context switching then the stack ... thread switching doesnt require the storage of stack for each thread ...
    (comp.unix.programmer)
  • Re: context switching
    ... >> I wonder why is context switching operation is considered to be heavy? ... > Every process created has its own stack space. ... Switching between threads is usually cheaper, ... and only the registers need to be updated. ...
    (comp.unix.programmer)
  • Re: how to let the gcc compiler optimizer know that my GCC inline asm code is using stack?
    ... Do you mean your inline assembly code is changing the stack or frame ... inline assembler sequences has finished. ... assembler sequence to let the compiler know you are changing the value ...
    (comp.arch.embedded)