[tarantool-patches] Re: [PATCH 2/3] Proper unwind for currently executing fiber
Konstantin Osipov
kostja at tarantool.org
Wed Sep 26 20:36:25 MSK 2018
* Georgy Kirichenko <georgy at tarantool.org> [18/09/26 10:46]:
> 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.
this is more clear, please add to the source code as a comment.
ok to push.
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov
More information about the Tarantool-patches
mailing list