I found boost has a class called context which is used for context switching, right?
I try to Google it but did not found any document or example. I am just wondering if anyone can provide some information.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Boost::Context is an official part of Boost in version 1.51.0 and up. See http://www.boost.org/doc/libs/1_51_0/libs/context/doc/html/index.html for information about it. Unfortunately the documentation is slightly different than the implementation, and some things have changed in SVN, so you’ll need to read the header files a little bit.
Here is an example I wrote the other day showing Boost::Context to make simple coroutines using Boost 1.51.0+latest SVN:
Then compiling and running looks like this: