Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 417 Bytes

README.md

File metadata and controls

19 lines (15 loc) · 417 Bytes

ThreadPool

C++ simpale ThreadPool

  • support sync call in the same thread. the calling thread need to waits for the worker thread.

    worker.sync_call([]{
      int ans = 0;
      for(int i = 1; i <= 100; i++)
      	ans += i;
      return ans;
    });
    
  • support async call in the same thread. the calling thread does not need to wait for the worker thread.

    worker.async_call([]{
      do_something();
    });