I already tried to use Boost.Coroutine but the overhead is very high. Now, I would like to perform an evaluation of two approaches, seems that the use of Boost.Context (without coroutines) is faster.




De: nat@lindenlab.com
Enviada: Terça-feira, 9 de Setembro de 2014 16:57
Para: boost-users@lists.boost.org
Assunto: [Boost-users] [context] Compiling error with context and bind

On Tue, Sep 9, 2014 at 4:47 PM, José <josessantos@zipmail.com.br> wrote:

> I changed the example jump.cpp from Context library to use a class, with
> fcontext_t as an attribute. I wrote the code below, but I can't compile it
> because there is an error in the use of boost::bind.
>
> What can be happening?
>
> foo->fc1 = ctx::make_fcontext( base1,
> stack_allocator::default_stacksize(), boost::bind(&FooClass::f1, foo, _1 ));

The documented signature of make_fcontext() accepts a classic C
function pointer:
http://www.boost.org/doc/libs/1_56_0/libs/context/doc/html/context/context/boost_fcontext.html
boost::bind() does not produce a classic C function pointer.

Boost.Context is a very low-level library, with distinct
platform-specific assembler implementations for various combinations
of OS and hardware. Boost.Coroutine is a more C++-level API built on
Boost.Context, and Coroutine almost certainly what you should be using
unless your requirements are pretty unusual.
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users