Skip to content

Commit bb921a1

Browse files
lexprfuncallfacebook-github-bot
authored andcommitted
Remove comments about madvise and CPUThreadPoolExecutor
Summary: CPUThreadPoolExecutor does not madvise-away the stacks of idle threads. Reviewed By: Gownta Differential Revision: D73703935 fbshipit-source-id: c1e777fa6641912a43644d5b853f32aeaa086204
1 parent 32ab088 commit bb921a1

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

folly/docs/Executors.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<ul>
4444
<li>A single queue backed by folly/LifoSem and folly/MPMC queue. Since there is only a single queue, contention can be quite high, since all the worker threads and all the producer threads hit the same queue. MPMC queue excels in this situation. MPMC queue dictates a max queue size.</li>
4545
<li>LifoSem wakes up threads in Lifo order - i.e. there are only few threads as necessary running, and we always try to reuse the same few threads for better cache locality.</li>
46-
<li>Inactive threads have their stack madvised away. This works quite well in combination with Lifosem - it almost doesn&#039;t matter if more threads than are necessary are specified at startup.</li>
46+
<li>All Folly BlockingQueue implementations use either LifoSem or ThrottledLifoSem, which madvise away the stack of threads that are inactive for a long time.</li>
4747
<li>stop() will finish all outstanding tasks at exit</li>
4848
<li>Supports priorities - priorities are implemented as multiple queues - each worker thread checks the highest priority queue first. Threads themselves don&#039;t have priorities set, so a series of long running low priority tasks could still hog all the threads. (at last check pthreads thread priorities didn&#039;t work very well)</li>
4949
</ul>
@@ -60,4 +60,3 @@
6060

6161
<p>PoolStats are provided to get task count, running time, waiting time, etc.</p>
6262
</section>
63-

folly/executors/CPUThreadPoolExecutor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ namespace folly {
5555
* @note LifoSem wakes up threads in Lifo order - i.e. there are only few
5656
* threads as necessary running, and we always try to reuse the same few threads
5757
* for better cache locality.
58-
* Inactive threads have their stack madvised away. This works quite well in
59-
* combination with Lifosem - it almost doesn't matter if more threads than are
60-
* necessary are specified at startup.
58+
* All Folly BlockingQueue implementations use either LifoSem or
59+
* ThrottledLifoSem, which madvise away the stack of threads that are inactive
60+
* for a long time.
6161
*
6262
* @note Supports priorities - priorities are implemented as multiple queues -
6363
* each worker thread checks the highest priority queue first. Threads

0 commit comments

Comments
 (0)