
9 Jan
2012
9 Jan
'12
7:28 p.m.
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