Boost logo

Boost :

Subject: Re: [boost] review request for boost.context
From: Oliver Kowalke (k-oli_at_[hidden])
Date: 2010-07-28 15:08:17


Am 28.07.2010 20:46, schrieb Emil Dotchevski:
>> No, because boost.context behaves like POSIX ucontext. The app exits if the
>> function executed by the context ends.
>
> I'm not familiar with ucontext, what is the rationale for that
> behavior?

If one context ends what should be the standard behaviour?
When the main-context (main function ends) - the app exits.
If you which to jump to the originating context (for instance it may be
main()) you can link against it and the originating context will
continue its execution.

> How do I go about creating a system where contexts are
> created and destroyed dynamically?

look into boost.fiber or boost.task

boost.fiber uses boost.context to implement cooperative scheduling and
boost.task uses boost.fiber to distribute several tasks on a limited set
of threads.

Oliver


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk