|
Boost : |
Subject: Re: [boost] [context] Implementation comments
From: Oliver Kowalke (k-oli_at_[hidden])
Date: 2011-01-19 06:58:06
so what? is it appropriate that boost::context has move semantics or not?
what I tried to explain is, that boost::context can be tracked as a resource as boost::thread.
-------- Original-Nachricht --------
> Datum: Wed, 19 Jan 2011 12:40:20 +0100
> Von: Andrzej Krzemienski <akrzemi1_at_[hidden]>
> An: boost_at_[hidden]
> Betreff: Re: [boost] [context] Implementation comments
> >>> Why is boost::thread implemented with move-semantics?
>
> >> Boost.Context is much more low level than Boost.Thread.
> > why? thread and context are resources - I don't see context more low
> > level than thread
>
> Hold on. I understand that that you are saying that context is the same
> level as thread. On the other hand in the reply to my question (about
> using
> boost::function) you said
>
> > boost.context is intended to be the basis of such things like coroutines
> > (see boost.coroutine) and fibers (see boost.fiber).
>
> Which somehow implied that Context is lower-level than Coroutine or Fiber.
> If you really treat Context the same level as Thread, I would suggest
> passing function<void()> as trampoline function. If you can afford using
> pimpl, you can easily change function<void()> to void(*)(void*) and void*
> parameters:
>
> void call( void* arg) {
> auto ptr = static_cast< function<void()>* >( arg );
> ptr->operator();
> }
>
> function<void()> trampoline = ...;
> context_impl( call, &trampoline );
>
> Using function<void()> makes it easier to understand for thread users and
> makes the interface similar to thread, task, etc...
>
> Regards,
> &rzej
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
-- GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk