rocksdb/util
sdong 3df07d1703 ThreadPool to allow decrease number of threads and increase of number of threads is to be instantly scheduled
Summary:
Add a feature to decrease the number of threads in thread pool.
Also instantly schedule more threads if number of threads is increased.

Here is the way it is implemented: each background thread needs its thread ID. After decreasing number of threads, all threads are woken up. The thread with the largest thread ID will terminate. If there are more threads to terminate, the thread will wake up all threads again.

Another change is made so that when number of threads is increased, more threads are created and all previous excessive threads are woken up to do the work.

Test Plan: Add a unit test.

Reviewers: haobo, dhruba

Reviewed By: haobo

CC: yhchiang, igor, nkg-, leveldb

Differential Revision: https://reviews.facebook.net/D18675
2014-05-19 11:52:12 -07:00
..
arena.cc declare kInline size in arena.cc 2014-05-14 12:40:49 -07:00
arena.h Fix errors while building with clang 2014-05-15 12:34:53 +08:00
arena_test.cc Arena to inline 2KB of data in it. 2014-05-14 11:49:01 -07:00
auto_roll_logger.cc
auto_roll_logger.h
auto_roll_logger_test.cc
autovector.h autovector::resize 2014-05-08 13:50:49 -07:00
autovector_test.cc autovector::resize 2014-05-08 13:50:49 -07:00
benchharness.cc
benchharness.h
benchharness_test.cc
blob_store.cc
blob_store.h
blob_store_test.cc
bloom.cc
bloom_test.cc Fix more gflag namespace issues 2014-05-09 08:41:02 -07:00
build_version.h
cache.cc
cache_test.cc
coding.cc
coding.h
coding_test.cc
comparator.cc
crc32c.cc
crc32c.h
crc32c_test.cc
dynamic_bloom.cc Pass logger to memtable rep and TLB page allocation error logged to info logs 2014-05-05 16:43:37 -07:00
dynamic_bloom.h Pass logger to memtable rep and TLB page allocation error logged to info logs 2014-05-05 16:43:37 -07:00
dynamic_bloom_test.cc Fix more gflag namespace issues 2014-05-09 08:41:02 -07:00
env.cc
env_hdfs.cc Improve EnvHdfs 2014-05-14 12:14:18 -07:00
env_posix.cc ThreadPool to allow decrease number of threads and increase of number of threads is to be instantly scheduled 2014-05-19 11:52:12 -07:00
env_test.cc ThreadPool to allow decrease number of threads and increase of number of threads is to be instantly scheduled 2014-05-19 11:52:12 -07:00
filelock_test.cc
filter_policy.cc
hash.cc
hash.h
hash_cuckoo_rep.cc Pass logger to memtable rep and TLB page allocation error logged to info logs 2014-05-05 16:43:37 -07:00
hash_cuckoo_rep.h Pass logger to memtable rep and TLB page allocation error logged to info logs 2014-05-05 16:43:37 -07:00
hash_linklist_rep.cc HashLinkedList::Iterator: remove an ununsed class variable 2014-05-08 13:28:52 -07:00
hash_linklist_rep.h Pass logger to memtable rep and TLB page allocation error logged to info logs 2014-05-05 16:43:37 -07:00
hash_skiplist_rep.cc Pass logger to memtable rep and TLB page allocation error logged to info logs 2014-05-05 16:43:37 -07:00
hash_skiplist_rep.h Pass logger to memtable rep and TLB page allocation error logged to info logs 2014-05-05 16:43:37 -07:00
histogram.cc
histogram.h
histogram_test.cc
ldb_cmd.cc
ldb_cmd.h
ldb_cmd_execute_result.h
ldb_tool.cc
log_buffer.cc
log_buffer.h Fix errors while building with clang 2014-05-15 12:34:53 +08:00
log_write_bench.cc Fix more gflag namespace issues 2014-05-09 08:41:02 -07:00
logging.cc Clean up compaction logging 2014-05-14 12:13:50 -07:00
logging.h Clean up compaction logging 2014-05-14 12:13:50 -07:00
manual_compaction_test.cc
murmurhash.cc
murmurhash.h
mutexlock.h
options.cc TablePropertiesCollectorFactory 2014-05-13 12:30:55 -07:00
perf_context.cc
perf_context_imp.h
posix_logger.h
random.h
signal_test.cc
skiplistrep.cc Pass logger to memtable rep and TLB page allocation error logged to info logs 2014-05-05 16:43:37 -07:00
slice.cc FixedPrefixTransform to include prefix length in its name 2014-05-13 16:08:21 -07:00
statistics.cc
statistics.h
stats_logger.h
status.cc
stl_wrappers.h
stop_watch.h
string_util.cc
string_util.h
sync_point.cc
sync_point.h
testharness.cc
testharness.h
testutil.cc
testutil.h
thread_local.cc
thread_local.h
thread_local_test.cc
vectorrep.cc Pass logger to memtable rep and TLB page allocation error logged to info logs 2014-05-05 16:43:37 -07:00
xxhash.cc
xxhash.h