Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Issue 9212043: Refactored thread pool (Closed)

Created:
8 years, 11 months ago by Søren Gjesse
Modified:
8 years, 10 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Refactored thread pool The thread pool has been refactored to hold all implementation state in the ThreadPool class and have all internal state protected by a single monitor. Added support for starting and stopping the same pool several times. When stopping the queue can be drained or not. Added two tests which handles messages. This change is based on https://chromiumcodereview.appspot.com/9141005/. R=iposva@google.com, ager@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=4181

Patch Set 1 #

Total comments: 14

Patch Set 2 : Addressed review comments from ager@ #

Total comments: 6

Patch Set 3 : Addressed more review comments from ager@ #

Patch Set 4 : Added timeout to thread pool termination #

Patch Set 5 : Rebased to r4180 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+167 lines, -103 lines) Patch
M runtime/bin/eventhandler.h View 2 chunks +2 lines, -3 lines 0 comments Download
M runtime/bin/thread_pool.h View 1 2 1 chunk +49 lines, -51 lines 0 comments Download
M runtime/bin/thread_pool.cc View 1 2 3 3 chunks +43 lines, -49 lines 0 comments Download
M runtime/bin/thread_pool_test.cc View 1 2 2 chunks +73 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Søren Gjesse
8 years, 11 months ago (2012-01-24 12:08:10 UTC) #1
Mads Ager (google)
https://chromiumcodereview.appspot.com/9212043/diff/1/runtime/bin/thread_pool.cc File runtime/bin/thread_pool.cc (right): https://chromiumcodereview.appspot.com/9212043/diff/1/runtime/bin/thread_pool.cc#newcode12 runtime/bin/thread_pool.cc:12: MonitorLocker monitor(&monitor_); MonitorLocker locker(&monitor_); ? Similarly for the other ...
8 years, 11 months ago (2012-01-24 12:29:38 UTC) #2
Søren Gjesse
https://chromiumcodereview.appspot.com/9212043/diff/1/runtime/bin/thread_pool.cc File runtime/bin/thread_pool.cc (right): https://chromiumcodereview.appspot.com/9212043/diff/1/runtime/bin/thread_pool.cc#newcode12 runtime/bin/thread_pool.cc:12: MonitorLocker monitor(&monitor_); On 2012/01/24 12:29:39, Mads Ager wrote: > ...
8 years, 11 months ago (2012-01-24 13:04:34 UTC) #3
Mads Ager (google)
lgtm https://chromiumcodereview.appspot.com/9212043/diff/7/runtime/bin/thread_pool.h File runtime/bin/thread_pool.h (right): https://chromiumcodereview.appspot.com/9212043/diff/7/runtime/bin/thread_pool.h#newcode34 runtime/bin/thread_pool.h:34: // Shutdown the thread pool. If drain flags ...
8 years, 11 months ago (2012-01-24 13:44:27 UTC) #4
Søren Gjesse
8 years, 11 months ago (2012-01-24 14:38:50 UTC) #5
https://chromiumcodereview.appspot.com/9212043/diff/7/runtime/bin/thread_pool.h
File runtime/bin/thread_pool.h (right):

https://chromiumcodereview.appspot.com/9212043/diff/7/runtime/bin/thread_pool...
runtime/bin/thread_pool.h:34: // Shutdown the thread pool. If drain flags
specifies whether all
On 2012/01/24 13:44:27, Mads Ager wrote:
> If drain flags -> The drain flag

Done.

https://chromiumcodereview.appspot.com/9212043/diff/7/runtime/bin/thread_pool...
runtime/bin/thread_pool.h:69: int size_;  // Current number of threads.
On 2012/01/24 13:44:27, Mads Ager wrote:
> size_ -> number_of_threads_?

Done.

https://chromiumcodereview.appspot.com/9212043/diff/7/runtime/bin/thread_pool...
File runtime/bin/thread_pool_test.cc (right):

https://chromiumcodereview.appspot.com/9212043/diff/7/runtime/bin/thread_pool...
runtime/bin/thread_pool_test.cc:74: printf("%d %d\n", task_count, task_sum);
On 2012/01/24 13:44:27, Mads Ager wrote:
> Remove debug printing?

Done.

Powered by Google App Engine
This is Rietveld 408576698