News for hackers. Stuff that matters.
Re:Show HN: Libconcurrent – Coroutines in C by halayli on Wednesday January 13, 2016 @12:55PM (#10896121)
You might also want to look at lthread. It has some interesting functions like lthread_compute_begin()/end() to run expensive computations inside a coroutine. the compute methods move the coroutine into an actual pthread and resume until compute_end() is called. It also has c++11 bindings called lthread-cpp which allows you to launch coroutines with variable arguments & types and comes with nice socket wrappers.

  void MyMethod(std::vector<int> my_vec) {}
  std::vector<int> v{1,2,3,4};
  Lthread t1{&MyMethod, v};
  t1.detach()

  void my_coroutine()
  {
     lthread_compute_begin();
       ret = fibonacci(55);
     lthread_compute_end();
  }

There are no comments on this comment yet.