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

Issue 9581039: Implement ThreadPool. (Closed)

Created:
8 years, 9 months ago by turnidge
Modified:
8 years, 9 months ago
Reviewers:
siva, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org, Søren Gjesse
Visibility:
Public.

Description

Implement ThreadPool. Committed: https://code.google.com/p/dart/source/detail?r=5484

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Total comments: 30

Patch Set 9 : #

Total comments: 6

Patch Set 10 : #

Patch Set 11 : #

Total comments: 16

Patch Set 12 : #

Total comments: 23

Patch Set 13 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+666 lines, -0 lines) Patch
A runtime/vm/thread_pool.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +115 lines, -0 lines 1 comment Download
A runtime/vm/thread_pool.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +328 lines, -0 lines 0 comments Download
A runtime/vm/thread_pool_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +220 lines, -0 lines 0 comments Download
M runtime/vm/vm_sources.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
turnidge
Ok, this is an implementation of a thread pool. It is different from Soren's implementation ...
8 years, 9 months ago (2012-03-03 02:35:21 UTC) #1
siva
https://chromiumcodereview.appspot.com/9581039/diff/12008/runtime/vm/thread_pool.cc File runtime/vm/thread_pool.cc (right): https://chromiumcodereview.appspot.com/9581039/diff/12008/runtime/vm/thread_pool.cc#newcode60 runtime/vm/thread_pool.cc:60: void ThreadPool::RemoveWorkerFromList(Worker* worker, Worker** head) { ASSERT(worker != NULL ...
8 years, 9 months ago (2012-03-06 05:07:00 UTC) #2
turnidge
https://chromiumcodereview.appspot.com/9581039/diff/12008/runtime/vm/thread_pool.cc File runtime/vm/thread_pool.cc (right): https://chromiumcodereview.appspot.com/9581039/diff/12008/runtime/vm/thread_pool.cc#newcode60 runtime/vm/thread_pool.cc:60: void ThreadPool::RemoveWorkerFromList(Worker* worker, Worker** head) { On 2012/03/06 05:07:00, ...
8 years, 9 months ago (2012-03-06 22:34:01 UTC) #3
Ivan Posva
Just a few quick things I noted. More to come... -Ivan https://chromiumcodereview.appspot.com/9581039/diff/15001/runtime/vm/thread_pool.cc File runtime/vm/thread_pool.cc (right): ...
8 years, 9 months ago (2012-03-07 01:06:05 UTC) #4
turnidge
Uploaded a new version with some fixes. https://chromiumcodereview.appspot.com/9581039/diff/15001/runtime/vm/thread_pool.cc File runtime/vm/thread_pool.cc (right): https://chromiumcodereview.appspot.com/9581039/diff/15001/runtime/vm/thread_pool.cc#newcode89 runtime/vm/thread_pool.cc:89: while (current ...
8 years, 9 months ago (2012-03-07 18:02:20 UTC) #5
siva
https://chromiumcodereview.appspot.com/9581039/diff/20001/runtime/vm/thread_pool.cc File runtime/vm/thread_pool.cc (right): https://chromiumcodereview.appspot.com/9581039/diff/20001/runtime/vm/thread_pool.cc#newcode35 runtime/vm/thread_pool.cc:35: worker = GetIdleWorker(); Why not treat the new thread ...
8 years, 9 months ago (2012-03-09 18:36:29 UTC) #6
turnidge
Ok. I've replaced state_ with a single boolean, owned_, which says whether the worker is ...
8 years, 9 months ago (2012-03-09 21:40:38 UTC) #7
siva
LGTM This implementation has worker threads taking the global thread pool lock after every task ...
8 years, 9 months ago (2012-03-14 17:36:09 UTC) #8
Ivan Posva
LGTM with comments. -Ivan http://codereview.chromium.org/9581039/diff/27001/runtime/vm/thread_pool.cc File runtime/vm/thread_pool.cc (right): http://codereview.chromium.org/9581039/diff/27001/runtime/vm/thread_pool.cc#newcode31 runtime/vm/thread_pool.cc:31: { // Grab ThreadPool::mutex_ before ...
8 years, 9 months ago (2012-03-14 18:51:26 UTC) #9
turnidge
https://chromiumcodereview.appspot.com/9581039/diff/27001/runtime/vm/thread_pool.cc File runtime/vm/thread_pool.cc (right): https://chromiumcodereview.appspot.com/9581039/diff/27001/runtime/vm/thread_pool.cc#newcode31 runtime/vm/thread_pool.cc:31: { On 2012/03/14 18:51:26, Ivan Posva wrote: > // ...
8 years, 9 months ago (2012-03-14 21:00:26 UTC) #10
Ivan Posva
8 years, 9 months ago (2012-03-15 00:27:33 UTC) #11
https://chromiumcodereview.appspot.com/9581039/diff/32002/runtime/vm/thread_p...
File runtime/vm/thread_pool.h (right):

https://chromiumcodereview.appspot.com/9581039/diff/32002/runtime/vm/thread_p...
runtime/vm/thread_pool.h:39: uint64_t workers_running() const { return
count_running_; }
I missed this in the first go around. Please do not use unsigned integers for
counts as this will cause problems when comparing to signed values as you
noticed yourself.

Powered by Google App Engine
This is Rietveld 408576698