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

Issue 8983017: Start of thread pool implementation (Closed)

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

Description

Start of thread pool implementation This the initial commit for adding a thread pool to the Dart server. For now it is hidden behind a flag (--enable_thread_pool) and when enabled just starts up and processes 100 void tasks. Mac OS implementation is not tested and Windows implementation is still pending. As we are currently not sharing anything between bin/ and vm/ I have just used pthread calls directly in the Linux and Mac OS implementation code. However with Monitor and Thread classes from vm/ the thread pool could be written platform independently. This can always be changed later. R=ager@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=2946

Patch Set 1 #

Patch Set 2 : Add new .h files to GYP as well #

Patch Set 3 : Remove pthread include in platform independent files #

Patch Set 4 : Fix compilation on Windows #

Total comments: 8

Patch Set 5 : Addressed review comments from ager@ #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+432 lines, -3 lines) Patch
M runtime/bin/builtin_sources.gypi View 1 2 chunks +8 lines, -1 line 0 comments Download
M runtime/bin/eventhandler_linux.h View 3 chunks +3 lines, -1 line 0 comments Download
M runtime/bin/eventhandler_linux.cc View 2 chunks +8 lines, -1 line 1 comment Download
A runtime/bin/thread_pool.h View 1 2 1 chunk +81 lines, -0 lines 0 comments Download
A runtime/bin/thread_pool.cc View 1 2 3 4 1 chunk +44 lines, -0 lines 0 comments Download
A runtime/bin/thread_pool_linux.h View 1 2 3 4 1 chunk +47 lines, -0 lines 0 comments Download
A runtime/bin/thread_pool_linux.cc View 1 2 3 4 1 chunk +67 lines, -0 lines 0 comments Download
A runtime/bin/thread_pool_macos.h View 1 2 3 4 1 chunk +47 lines, -0 lines 0 comments Download
A runtime/bin/thread_pool_macos.cc View 1 2 3 4 1 chunk +67 lines, -0 lines 0 comments Download
A runtime/bin/thread_pool_win.h View 1 2 3 1 chunk +35 lines, -0 lines 0 comments Download
A runtime/bin/thread_pool_win.cc View 1 2 3 1 chunk +25 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Søren Gjesse
8 years, 11 months ago (2012-01-04 13:38:29 UTC) #1
Mads Ager (google)
lgtm http://codereview.chromium.org/8983017/diff/4002/runtime/bin/thread_pool.cc File runtime/bin/thread_pool.cc (right): http://codereview.chromium.org/8983017/diff/4002/runtime/bin/thread_pool.cc#newcode30 runtime/bin/thread_pool.cc:30: printf("Thread pool thread started\n"); Should we remove this ...
8 years, 11 months ago (2012-01-04 14:32:46 UTC) #2
Søren Gjesse
http://codereview.chromium.org/8983017/diff/4002/runtime/bin/thread_pool.cc File runtime/bin/thread_pool.cc (right): http://codereview.chromium.org/8983017/diff/4002/runtime/bin/thread_pool.cc#newcode30 runtime/bin/thread_pool.cc:30: printf("Thread pool thread started\n"); On 2012/01/04 14:32:46, Mads Ager ...
8 years, 11 months ago (2012-01-04 15:15:07 UTC) #3
Ivan Posva
8 years, 11 months ago (2012-01-04 17:26:34 UTC) #4
Overall I am not convinced this is the right way to approach a thread pool. Can
we please discuss the design and plan before moving any further?

Thanks,
-Ivan

http://codereview.chromium.org/8983017/diff/2003/runtime/bin/eventhandler_lin...
File runtime/bin/eventhandler_linux.cc (right):

http://codereview.chromium.org/8983017/diff/2003/runtime/bin/eventhandler_lin...
runtime/bin/eventhandler_linux.cc:376: for (int i = 0; i < 100; i++) {
This is non-sensical. Please make this into a proper testcase.

Powered by Google App Engine
This is Rietveld 408576698