1

I asked a question about multithreading here a while ago but didn't get any answers so I will delete it and rephrase it here.

Is there any sort of functionality in a C or C++ (I am by no means implying that they are the same language) library that can be used to imitate switching contexts like you can using the python greenlets?

Anything that is not deprecated would be greatly appreciated!

Thank you!

Curious
  • 20,870
  • 8
  • 61
  • 146
  • Boost coroutines? http://www.boost.org/doc/libs/1_59_0/libs/coroutine/doc/html/coroutine/overview.html – Severin Pappadeux Dec 25 '15 at 02:18
  • Or maybe Boost context? http://www.boost.org/doc/libs/1_59_0/libs/context/doc/html/context/overview.html – Severin Pappadeux Dec 25 '15 at 02:20
  • isn't that being developed at the moment? – Curious Dec 25 '15 at 02:22
  • well, one can say Boost is always under development. But if we look at latest release (which happens to be 1.60), there are three libraries in the whole release, which tagged "release" and might be of interest to you: Coroutine, Coroutine2, Context. Link: http://www.boost.org/doc/libs/1_60_0/ – Severin Pappadeux Dec 25 '15 at 02:40
  • I am trying to see the implementation of boost context but I am not able to. Would you know where I can find the source code for that? I am trying to look in the boost/context folder but I cannot find it – Curious Dec 25 '15 at 02:55
  • Please check http://sourceforge.net/projects/boost/files/boost/1.60.0/, here is archive with all Boost libraries, download it and unpack and inside wthere would be `boost` directory with all sources, one dir per project, you're looking for `coroutine`, `coroutine2` and `context` – Severin Pappadeux Dec 25 '15 at 03:24
  • I am seeing the header file fcontext.hpp with the declaration of jump_fcontext but I cannot find the implementation of it. Could you help pleaseee? – Curious Dec 25 '15 at 03:42
  • I think I found it in libs/context/asm – Curious Dec 25 '15 at 03:46
  • Sorry, cannot help with the internals of those libraries, I think I've used `coroutines` in one project and that's it. You could subscribe to the boost-developers mailing list and start asking questions there: http://www.boost.org/development/submissions.html – Severin Pappadeux Dec 25 '15 at 05:38
  • That's ok! Thank you – Curious Dec 25 '15 at 05:40

0 Answers0