priority CPU thread pool
authorJames Sedgwick <jsedgwick@fb.com>
Mon, 17 Nov 2014 22:44:10 +0000 (14:44 -0800)
committerDave Watson <davejwatson@fb.com>
Wed, 19 Nov 2014 20:52:31 +0000 (12:52 -0800)
commitfe22c76c53069bb4f1338a5fa6ffeb6a8a2a5923
tree21d671b0dedccffbf8354a7472ac1c593d68cffd
parent146fda299bd4885b753732216c4370199db83c5d
priority CPU thread pool

Summary:
just extend CPUThreadPoolExecutor to use a queue that is itself composed of N mpmc queues, one per priority

the verbosity is starting to kill me, i had thought before of truncating Executor of all these pool types and now I'm definitely going to do that unless someone fights me.

Test Plan: added unit; maybe i'm not being clever enough as i couldn't think of many ways to test this reliably so there's just a basic preemption test

Reviewed By: davejwatson@fb.com

Subscribers: trunkagent, fugalh, njormrod, folly-diffs@, bmatheny

FB internal diff: D1676452

Tasks: 5002392

Signature: t1:1676452:1416263990:cdf5d44e4a50a6180ba547a3ed4c0c24d4ffdd8f
folly/experimental/wangle/concurrent/BlockingQueue.h
folly/experimental/wangle/concurrent/CPUThreadPoolExecutor.cpp
folly/experimental/wangle/concurrent/CPUThreadPoolExecutor.h
folly/experimental/wangle/concurrent/PriorityLifoSemMPMCQueue.h [new file with mode: 0644]
folly/experimental/wangle/concurrent/test/ThreadPoolExecutorTest.cpp