Subject: Re: [boost] [context] new version - support for Win64
From: Oliver Kowalke (k-oli_at_[hidden])
Date: 2010-12-18 16:01:07
using a simple function pointer and a void * as its argument makes the
implementation in assembler easier.
boost.context is intended to be the basis of such things like coroutines
(see boost.coroutine) and fibers (see boost.fiber).
Both libs allow to use arbitrary function objects.
The function pointer is not a callback it is the function executed in
the context and the void ptr is its argument.
If you require to use boost.function you could easily create an object
containing a boost::context and your boost:function instance. The
context executes a trampoline function which will be invoked with the
pointer to this object as argument. For more details look into boost.fiber.
Am 18.12.2010 21:30, schrieb Andrzej Krzemienski:
>> I've uploaded boost.context-0.3.0.zip to boost vault.
> I am new to the idea of context switching, and the idea seams very
> interesting. I have gotone question regarding the interface. The two
> arguments that are passed when creating a new context, of type
> void(*)(void*) and void* look like a way of providing a callback. I am used
> to, in Boost libraries and C++0x threads, to see function<void()> as a type
> of callbcak. Is there a reason for not using it in case of context
> Unsubscribe& other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk