A thread-per-task executor
authorYedidya Feldblum <yfeldblum@fb.com>
Sat, 14 May 2016 11:29:37 +0000 (04:29 -0700)
committerFacebook Github Bot 2 <facebook-github-bot-2-bot@fb.com>
Sat, 14 May 2016 11:38:25 +0000 (04:38 -0700)
commit0afc127248ddfd944ec11648ff066d783b87c078
tree66c48130629f8d0f59c37ad2fdc70c2deaab5f9d
parentbc02b7a42d2424af74fa526349d2a531a49c83d3
A thread-per-task executor

Summary:
[Wangle] A thread-per-task executor.

Moved from Folly into Wangle and fleshed out.
* Starts task threads from a control thread, rather than starting task threads from the submitter thread. Because starting task threads is likely to be more expensive than moving a functor.
* Joins task threads as they finish, rather than joining all task threads in the executor's destructor.

Suitable for running tasks which spend most of their time sleeping. Such as blocking IO, blocking fork-exec-wait, etc., when it is inconvenient to use the nonblocking variants with an IO executor.

Reviewed By: simpkins

Differential Revision: D3286988

fbshipit-source-id: 4b91133a7d55332ebbae020c1515c60e816906b3
folly/Makefile.am
folly/futures/ThreadedExecutor.cpp [deleted file]
folly/futures/ThreadedExecutor.h [deleted file]
folly/futures/test/ThreadedExecutorTest.cpp [deleted file]