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

Issue 14046031: Worker changes to prepare for lock-free shutdown. (Closed)

Created:
7 years, 8 months ago by haitaol1
Modified:
7 years, 6 months ago
CC:
chromium-reviews, Raghu Simha, akalin, tim (not reviewing)
Visibility:
Public.

Description

Worker changes to prepare for lock-free shutdown. * Make worker observe the destruction of the thread where it does work. * Make work done signal a memeber of worker and set it when worker's working thread is destroyed so that syncer won't be blocked indefinitely on work that's not gonna run. * Ref-count worker in session context so that worker remains valid when syncer is still iterating through workers but registrar has erased it from its worker map. * Add RequestStop() and Stopped() to allow worker to return early when it's stopped while waiting to run work on its working thread. This cl by itself should have no real impact because the added functions are not used. BUG=19757 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=202786

Patch Set 1 #

Patch Set 2 : #

Total comments: 24

Patch Set 3 : #

Total comments: 4

Patch Set 4 : #

Total comments: 13

Patch Set 5 : #

Total comments: 4

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+298 lines, -89 lines) Patch
M chrome/browser/sync/glue/browser_thread_model_worker.h View 1 2 3 4 3 chunks +10 lines, -7 lines 0 comments Download
M chrome/browser/sync/glue/browser_thread_model_worker.cc View 1 2 3 4 3 chunks +29 lines, -12 lines 0 comments Download
M chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/history_model_worker.h View 1 2 3 4 2 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/sync/glue/history_model_worker.cc View 1 2 3 4 4 chunks +37 lines, -12 lines 0 comments Download
M chrome/browser/sync/glue/password_model_worker.h View 1 2 3 4 2 chunks +11 lines, -4 lines 0 comments Download
M chrome/browser/sync/glue/password_model_worker.cc View 1 2 3 4 2 chunks +17 lines, -6 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_registrar.h View 1 2 2 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/sync_backend_registrar.cc View 1 2 2 chunks +12 lines, -6 lines 0 comments Download
M chrome/browser/sync/glue/ui_model_worker.h View 1 2 3 4 3 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/sync/glue/ui_model_worker.cc View 1 2 3 4 4 chunks +12 lines, -7 lines 0 comments Download
M chrome/browser/sync/glue/ui_model_worker_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M sync/internal_api/internal_components_factory_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M sync/internal_api/public/engine/model_safe_worker.h View 1 2 3 4 2 chunks +56 lines, -7 lines 0 comments Download
M sync/internal_api/public/engine/model_safe_worker.cc View 1 2 3 4 5 1 chunk +52 lines, -0 lines 0 comments Download
M sync/internal_api/public/engine/passive_model_worker.h View 1 2 3 4 1 chunk +7 lines, -3 lines 0 comments Download
M sync/internal_api/public/engine/passive_model_worker.cc View 1 2 3 4 1 chunk +10 lines, -3 lines 0 comments Download
M sync/internal_api/public/internal_components_factory.h View 1 chunk +1 line, -1 line 0 comments Download
M sync/internal_api/public/internal_components_factory_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M sync/internal_api/public/test/test_internal_components_factory.h View 1 chunk +1 line, -1 line 0 comments Download
M sync/internal_api/test/test_internal_components_factory.cc View 1 chunk +1 line, -1 line 0 comments Download
M sync/sessions/sync_session_context.h View 2 chunks +2 lines, -2 lines 0 comments Download
M sync/sessions/sync_session_context.cc View 2 chunks +3 lines, -1 line 0 comments Download
M sync/test/engine/fake_model_worker.h View 1 2 3 4 1 chunk +5 lines, -2 lines 0 comments Download
M sync/test/engine/fake_model_worker.cc View 1 2 3 4 2 chunks +8 lines, -2 lines 0 comments Download
M sync/tools/sync_client.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 18 (0 generated)
haitaol1
ping
7 years, 8 months ago (2013-04-24 17:16:42 UTC) #1
rlarocque
I think I see what you're aiming for, but I'm not sure how it's supposed ...
7 years, 8 months ago (2013-04-24 22:18:04 UTC) #2
haitaol1
On 2013/04/24 22:18:04, rlarocque wrote: > I think I see what you're aiming for, but ...
7 years, 8 months ago (2013-04-25 20:14:11 UTC) #3
haitaol
On Thu, Apr 25, 2013 at 1:14 PM, <haitaol@chromium.org> wrote: > On 2013/04/24 22:18:04, rlarocque ...
7 years, 8 months ago (2013-04-25 20:31:46 UTC) #4
haitaol1
ping On 2013/04/25 20:31:46, haitaol wrote: > On Thu, Apr 25, 2013 at 1:14 PM, ...
7 years, 7 months ago (2013-05-10 16:48:34 UTC) #5
tim (not reviewing)
https://codereview.chromium.org/14046031/diff/2001/chrome/browser/sync/glue/sync_backend_registrar.cc File chrome/browser/sync/glue/sync_backend_registrar.cc (right): https://codereview.chromium.org/14046031/diff/2001/chrome/browser/sync/glue/sync_backend_registrar.cc#newcode62 chrome/browser/sync/glue/sync_backend_registrar.cc:62: ui_worker_(new UIModelWorker(ALLOW_THIS_IN_INITIALIZER_LIST(this))), See http://src.chromium.org/viewvc/chrome?revision=197671&view=revision. https://codereview.chromium.org/14046031/diff/2001/chrome/browser/sync/glue/sync_backend_registrar.h File chrome/browser/sync/glue/sync_backend_registrar.h (right): https://codereview.chromium.org/14046031/diff/2001/chrome/browser/sync/glue/sync_backend_registrar.h#newcode38 ...
7 years, 7 months ago (2013-05-14 04:14:29 UTC) #6
haitaol1
https://codereview.chromium.org/14046031/diff/2001/chrome/browser/sync/glue/sync_backend_registrar.cc File chrome/browser/sync/glue/sync_backend_registrar.cc (right): https://codereview.chromium.org/14046031/diff/2001/chrome/browser/sync/glue/sync_backend_registrar.cc#newcode62 chrome/browser/sync/glue/sync_backend_registrar.cc:62: ui_worker_(new UIModelWorker(ALLOW_THIS_IN_INITIALIZER_LIST(this))), On 2013/05/14 04:14:29, timsteele wrote: > See ...
7 years, 7 months ago (2013-05-15 23:39:21 UTC) #7
tim (not reviewing)
https://codereview.chromium.org/14046031/diff/14001/sync/internal_api/public/engine/model_safe_worker.h File sync/internal_api/public/engine/model_safe_worker.h (right): https://codereview.chromium.org/14046031/diff/14001/sync/internal_api/public/engine/model_safe_worker.h#newcode81 sync/internal_api/public/engine/model_safe_worker.h:81: void RequestStop(); If this is called from the UI ...
7 years, 7 months ago (2013-05-16 18:15:42 UTC) #8
haitaol1
https://codereview.chromium.org/14046031/diff/14001/sync/internal_api/public/engine/model_safe_worker.h File sync/internal_api/public/engine/model_safe_worker.h (right): https://codereview.chromium.org/14046031/diff/14001/sync/internal_api/public/engine/model_safe_worker.h#newcode81 sync/internal_api/public/engine/model_safe_worker.h:81: void RequestStop(); lock_ is also used to serialize signal/reset ...
7 years, 7 months ago (2013-05-17 16:24:59 UTC) #9
tim (not reviewing)
https://codereview.chromium.org/14046031/diff/20001/chrome/browser/sync/glue/ui_model_worker.cc File chrome/browser/sync/glue/ui_model_worker.cc (right): https://codereview.chromium.org/14046031/diff/20001/chrome/browser/sync/glue/ui_model_worker.cc#newcode89 chrome/browser/sync/glue/ui_model_worker.cc:89: done->Wait(); Do we need to pass the event around? ...
7 years, 7 months ago (2013-05-17 20:51:32 UTC) #10
haitaol1
https://codereview.chromium.org/14046031/diff/20001/chrome/browser/sync/glue/ui_model_worker.cc File chrome/browser/sync/glue/ui_model_worker.cc (right): https://codereview.chromium.org/14046031/diff/20001/chrome/browser/sync/glue/ui_model_worker.cc#newcode89 chrome/browser/sync/glue/ui_model_worker.cc:89: done->Wait(); Added protected accessor. On 2013/05/17 20:51:33, timsteele wrote: ...
7 years, 7 months ago (2013-05-17 22:06:57 UTC) #11
tim (not reviewing)
Thanks, that made it easier to review. Getting there, have one more significant comment. https://codereview.chromium.org/14046031/diff/20001/sync/internal_api/public/engine/model_safe_worker.cc ...
7 years, 7 months ago (2013-05-20 17:22:38 UTC) #12
tim (not reviewing)
We discussed my most lengthy comment offline and decided it's probably unnecessary to add WeakPtrs ...
7 years, 7 months ago (2013-05-23 01:21:16 UTC) #13
haitaol1
https://codereview.chromium.org/14046031/diff/20001/sync/internal_api/public/engine/model_safe_worker.cc File sync/internal_api/public/engine/model_safe_worker.cc (right): https://codereview.chromium.org/14046031/diff/20001/sync/internal_api/public/engine/model_safe_worker.cc#newcode106 sync/internal_api/public/engine/model_safe_worker.cc:106: work_done_or_stopped_.Reset(); With manual_reset=true, Reset() becomes necessary because the signal ...
7 years, 7 months ago (2013-05-23 16:07:29 UTC) #14
tim (not reviewing)
https://codereview.chromium.org/14046031/diff/20001/sync/internal_api/public/engine/model_safe_worker.cc File sync/internal_api/public/engine/model_safe_worker.cc (right): https://codereview.chromium.org/14046031/diff/20001/sync/internal_api/public/engine/model_safe_worker.cc#newcode106 sync/internal_api/public/engine/model_safe_worker.cc:106: work_done_or_stopped_.Reset(); On 2013/05/23 16:07:29, haitaol1 wrote: > With manual_reset=true, ...
7 years, 7 months ago (2013-05-23 18:10:36 UTC) #15
haitaol1
On 2013/05/23 18:10:36, timsteele wrote: > https://codereview.chromium.org/14046031/diff/20001/sync/internal_api/public/engine/model_safe_worker.cc > File sync/internal_api/public/engine/model_safe_worker.cc (right): > > https://codereview.chromium.org/14046031/diff/20001/sync/internal_api/public/engine/model_safe_worker.cc#newcode106 > ...
7 years, 7 months ago (2013-05-23 18:23:43 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haitaol@chromium.org/14046031/31001
7 years, 6 months ago (2013-05-28 22:26:34 UTC) #17
commit-bot: I haz the power
7 years, 6 months ago (2013-05-29 06:50:46 UTC) #18
Message was sent while issue was closed.
Change committed as 202786

Powered by Google App Engine
This is Rietveld 408576698