[tarantool-patches] Re: [PATCH 2/3] Proper unwind for currently executing fiber

Georgy Kirichenko georgy at tarantool.org
Wed Sep 26 09:57:07 MSK 2018


On Wednesday, September 26, 2018 2:34:02 AM MSK Konstantin Osipov wrote:
> * Georgy Kirichenko <georgy at tarantool.org> [18/09/22 00:21]:
> > A fiber's coro context stores execution state for a corresponding
> > already yielded fiber. If fiber is on the execution then it hasn't
> > valid stored coro state and might be backtraced without a special unwind
> > context builder.
> 
> I did not understand what's going on from the comment. I assume
> this is an optimization, in which you try to avoid re-fetching the
> registers in some cases?
> 
> Please clarify.
> 
> > --

Each yielded fiber has a preserved coro state stored in a corresponding 
variable however an executing fiber has a volatile state placed in CPU 
registers (stack pointer, instruction pointer and non-volatile registers) and 
corresponding context-storing variable value is invalid.
For already yielded fiber we use a special asm-written handler to make a 
temporary switch to the preserved state and capture executing context what is 
not needed for executing fiber. 
After the patch for the executing fiber NULL is passed to the backtrace 
function as coro context and then backtrace function could decide should it 
use special context-switching handler or might just use unw_getcontext from 
the unwind library.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20180926/3c3cc056/attachment.sig>


More information about the Tarantool-patches mailing list