|
Boost : |
Subject: Re: [boost] [boost::context] reusing stacks
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2012-11-27 03:31:33
Am 27.11.2012 09:25 schrieb "Valentin Milea" <valentin.milea_at_[hidden]>:
>
> Just to make sure, this means sample code is actually legal?
yes as long as you do not expect that you can use two or mor context's
sharing a stack at the same time. In your example the first context is
destroyed by the second call of make_fcontext().
> On Tue, Nov 27, 2012 at 10:09 AM, Oliver Kowalke
> <oliver.kowalke_at_[hidden]> wrote:
> > == context is not used further
> > make_fcontext() returns a pointer to fcontext_t which is placed at the
top
> > of the stack
> > If you call make_fcontext() again with the same stack the content of the
> > previous fcontext_t will be destroyed
> > Am 27.11.2012 08:59 schrieb "Valentin Milea" <valentin.milea_at_[hidden]>:
> >
> >> How do you deallocate a context? With fc being just a struct pointer
> >> at beginning of stack, I assumed no special action needed.
> >>
> >> > yes, but only one context is allowed to own the stack. If the
context is
> >> > deallocated you could asign the stack to another context via
> >> > make_fcontext() instead to deallocate it.
> >> >
> >> > Therefore your code is not correct (two context's share the same
stack at
> >> > the same time).
> >>
> >> _______________________________________________
> >> Unsubscribe & other changes:
> >> http://lists.boost.org/mailman/listinfo.cgi/boost
> >>
> >
> > _______________________________________________
> > Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/list
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk