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

Issue 2142273004: Worker: Remove locking from WorkerThread::postTask() (Closed)

Created:
4 years, 5 months ago by nhiroki
Modified:
4 years, 5 months ago
Reviewers:
kinuko, yhirano
CC:
chromium-reviews, blink-reviews, kinuko+worker_chromium.org, falken, blink-worker-reviews_chromium.org, horo+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Worker: Remove locking from WorkerThread::postTask() WorkerThread::postTask() can be called from various places and locking in the function may lead to deadlock. To avoid the problem, this CL removes locking from WorkerThread::postTask() and makes it possible to safely access to shared flags without locking. BUG=620442 Committed: https://crrev.com/18d1be3c48e503e5d080361f8fe6df7cfd2b503e Cr-Commit-Position: refs/heads/master@{#405715}

Patch Set 1 #

Patch Set 2 : fix thread affinity of posted tasks #

Total comments: 12

Patch Set 3 : address review comments #

Patch Set 4 : introduce isInShutdown() #

Patch Set 5 : clean up more #

Total comments: 6

Patch Set 6 : call isInShutdown() more #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -17 lines) Patch
M third_party/WebKit/Source/core/workers/WorkerThread.h View 1 2 3 2 chunks +16 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerThread.cpp View 1 2 3 4 5 5 chunks +22 lines, -17 lines 0 comments Download

Messages

Total messages: 37 (18 generated)
nhiroki
Hi, can you review this? Thanks!
4 years, 5 months ago (2016-07-14 02:14:13 UTC) #7
yhirano
Is it possible to remove m_terminate / m_readyShutdown checks from postTask and put those checks ...
4 years, 5 months ago (2016-07-14 05:21:54 UTC) #8
yhirano
On 2016/07/14 05:21:54, yhirano wrote: > Is it possible to remove m_terminate / m_readyShutdown checks ...
4 years, 5 months ago (2016-07-14 05:23:40 UTC) #9
kinuko
https://codereview.chromium.org/2142273004/diff/80001/third_party/WebKit/Source/core/workers/WorkerThread.cpp File third_party/WebKit/Source/core/workers/WorkerThread.cpp (left): https://codereview.chromium.org/2142273004/diff/80001/third_party/WebKit/Source/core/workers/WorkerThread.cpp#oldcode248 third_party/WebKit/Source/core/workers/WorkerThread.cpp:248: return; Actually it seems ok to just remove this ...
4 years, 5 months ago (2016-07-14 05:30:53 UTC) #10
nhiroki
Thank you for reviewing! Updated a patch and replied to comments about removing flag checks ...
4 years, 5 months ago (2016-07-14 08:00:41 UTC) #11
kinuko
https://codereview.chromium.org/2142273004/diff/80001/third_party/WebKit/Source/core/workers/WorkerThread.cpp File third_party/WebKit/Source/core/workers/WorkerThread.cpp (right): https://codereview.chromium.org/2142273004/diff/80001/third_party/WebKit/Source/core/workers/WorkerThread.cpp#newcode571 third_party/WebKit/Source/core/workers/WorkerThread.cpp:571: workerBackingThread().backingThread().postTask(location, crossThreadBind(&WorkerThread::performTaskOnWorkerThread, crossThreadUnretained(this), passed(std::move(task)), isInstrumented)); On 2016/07/14 08:00:40, nhiroki ...
4 years, 5 months ago (2016-07-14 09:31:49 UTC) #12
nhiroki
Thank you! Addressed all review comments. Can you take another look? https://codereview.chromium.org/2142273004/diff/80001/third_party/WebKit/Source/core/workers/WorkerThread.cpp File third_party/WebKit/Source/core/workers/WorkerThread.cpp (right): ...
4 years, 5 months ago (2016-07-15 02:17:50 UTC) #16
kinuko
lgtm https://codereview.chromium.org/2142273004/diff/160001/third_party/WebKit/Source/core/workers/WorkerThread.cpp File third_party/WebKit/Source/core/workers/WorkerThread.cpp (right): https://codereview.chromium.org/2142273004/diff/160001/third_party/WebKit/Source/core/workers/WorkerThread.cpp#newcode257 third_party/WebKit/Source/core/workers/WorkerThread.cpp:257: if (m_terminated) nit: at this point we could ...
4 years, 5 months ago (2016-07-15 03:14:36 UTC) #17
nhiroki
Thank you! https://codereview.chromium.org/2142273004/diff/160001/third_party/WebKit/Source/core/workers/WorkerThread.cpp File third_party/WebKit/Source/core/workers/WorkerThread.cpp (right): https://codereview.chromium.org/2142273004/diff/160001/third_party/WebKit/Source/core/workers/WorkerThread.cpp#newcode257 third_party/WebKit/Source/core/workers/WorkerThread.cpp:257: if (m_terminated) On 2016/07/15 03:14:36, kinuko wrote: ...
4 years, 5 months ago (2016-07-15 04:35:43 UTC) #22
kinuko
https://codereview.chromium.org/2142273004/diff/160001/third_party/WebKit/Source/core/workers/WorkerThread.cpp File third_party/WebKit/Source/core/workers/WorkerThread.cpp (right): https://codereview.chromium.org/2142273004/diff/160001/third_party/WebKit/Source/core/workers/WorkerThread.cpp#newcode257 third_party/WebKit/Source/core/workers/WorkerThread.cpp:257: if (m_terminated) On 2016/07/15 04:35:43, nhiroki (slow) wrote: > ...
4 years, 5 months ago (2016-07-15 04:54:42 UTC) #23
nhiroki
https://codereview.chromium.org/2142273004/diff/160001/third_party/WebKit/Source/core/workers/WorkerThread.cpp File third_party/WebKit/Source/core/workers/WorkerThread.cpp (right): https://codereview.chromium.org/2142273004/diff/160001/third_party/WebKit/Source/core/workers/WorkerThread.cpp#newcode257 third_party/WebKit/Source/core/workers/WorkerThread.cpp:257: if (m_terminated) On 2016/07/15 04:54:42, kinuko wrote: > On ...
4 years, 5 months ago (2016-07-15 06:13:56 UTC) #26
nhiroki
yhirano-san, can I land this?
4 years, 5 months ago (2016-07-15 06:15:04 UTC) #27
yhirano
On 2016/07/15 06:15:04, nhiroki (slow) wrote: > yhirano-san, can I land this? Sorry, can you ...
4 years, 5 months ago (2016-07-15 07:07:56 UTC) #28
nhiroki
On 2016/07/15 07:07:56, yhirano wrote: > On 2016/07/15 06:15:04, nhiroki (slow) wrote: > > yhirano-san, ...
4 years, 5 months ago (2016-07-15 07:11:07 UTC) #29
yhirano
lgtm
4 years, 5 months ago (2016-07-15 07:20:03 UTC) #30
nhiroki
On 2016/07/15 07:20:03, yhirano wrote: > lgtm Thank yoU!
4 years, 5 months ago (2016-07-15 07:24:48 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2142273004/180001
4 years, 5 months ago (2016-07-15 07:25:13 UTC) #34
commit-bot: I haz the power
Committed patchset #6 (id:180001)
4 years, 5 months ago (2016-07-15 07:30:13 UTC) #35
commit-bot: I haz the power
4 years, 5 months ago (2016-07-15 07:32:25 UTC) #37
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/18d1be3c48e503e5d080361f8fe6df7cfd2b503e
Cr-Commit-Position: refs/heads/master@{#405715}

Powered by Google App Engine
This is Rietveld 408576698