Boost logo

Boost :

Subject: Re: [boost] [context review] Performance questions
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2012-01-09 14:28:15


Am 09.01.2012 19:54, schrieb Antony Polukhin:
> 2) Can we use contexts like condition variables? Can we make something
> like this:
>
> struct task{
> // Implementanion
> };
>
> std::deque<task> g_tasks;
> continuation g_cont;
> boost::thread::mutex g_mutex;
>
<snip>

boost.context isn't related to threads.
It doesn't deal with context switches related to threads (the kernel
doesn't see switches done by boost.context).
from docu: 'A context switch between threads requires system calls
(involving the OS kernel), ... By contrast, transferring control among
boost.context requires only a few hundred CPU cycles because it does not
involve system calls as it is done within a single thread.'

Oliver


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