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

Issue 955803002: SkTRacy<T> -> SkAtomic<T> (Closed)

Created:
5 years, 10 months ago by mtklein_C
Modified:
5 years, 9 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

SkTRacy<T> -> SkAtomic<T> Like SkTRacy<T>, TSAN will not complain about these. Unlike SkTRacy<T>, TSAN should not complain about these: SkAtomic<T> are threadsafe. This should fix the races now suppressed in TSAN. As written, the memory barriers we're using in SkPixelRef will be dumb but safe (really, dumbest possible but safest possible). If we see a perf hit, we can follow up by putting Ben and I in a room for a while, thinking about it really hard, and using the minimum-strength safe memory barriers. A refactor that steals a bit from the genID would also still be possible with this approach. BUG=chromium:437511 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN-Trybot Committed: https://skia.googlesource.com/skia/+/86821b56704ebc0a1a6d1e5d1e329369ac797c98

Patch Set 1 #

Patch Set 2 : prune more #

Patch Set 3 : rebase #

Patch Set 4 : great warning #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -46 lines) Patch
M include/core/SkAtomics.h View 1 2 3 1 chunk +20 lines, -0 lines 0 comments Download
M include/core/SkDynamicAnnotations.h View 1 2 chunks +0 lines, -29 lines 0 comments Download
M include/core/SkPixelRef.h View 2 chunks +5 lines, -5 lines 0 comments Download
M src/core/SkPixelRef.cpp View 1 2 4 chunks +14 lines, -12 lines 2 comments Download

Messages

Total messages: 15 (7 generated)
mtklein_C
5 years, 10 months ago (2015-02-24 22:18:55 UTC) #2
reed2
lgtm
5 years, 10 months ago (2015-02-24 22:21:40 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/955803002/40001
5 years, 10 months ago (2015-02-24 22:27:45 UTC) #6
commit-bot: I haz the power
Try jobs failed on following builders: Build-Ubuntu13.10-Clang-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu13.10-Clang-x86_64-Debug-Trybot/builds/2258)
5 years, 10 months ago (2015-02-24 22:28:46 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/955803002/60001
5 years, 10 months ago (2015-02-24 22:31:05 UTC) #11
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://skia.googlesource.com/skia/+/86821b56704ebc0a1a6d1e5d1e329369ac797c98
5 years, 10 months ago (2015-02-24 22:38:17 UTC) #12
Alexander Potapenko
https://codereview.chromium.org/955803002/diff/60001/src/core/SkPixelRef.cpp File src/core/SkPixelRef.cpp (right): https://codereview.chromium.org/955803002/diff/60001/src/core/SkPixelRef.cpp#newcode125 src/core/SkPixelRef.cpp:125: fGenerationID.store(0); Perhaps the sk_memory_order_acquire and sk_memory_order_release should be enough ...
5 years, 9 months ago (2015-03-10 09:55:20 UTC) #14
mtklein
5 years, 9 months ago (2015-03-10 13:33:12 UTC) #15
Message was sent while issue was closed.
https://codereview.chromium.org/955803002/diff/60001/src/core/SkPixelRef.cpp
File src/core/SkPixelRef.cpp (right):

https://codereview.chromium.org/955803002/diff/60001/src/core/SkPixelRef.cpp#...
src/core/SkPixelRef.cpp:125: fGenerationID.store(0);
On 2015/03/10 09:55:20, Alexander Potapenko wrote:
> Perhaps the sk_memory_order_acquire and sk_memory_order_release should be
enough
> here.
> Agreed this isn't necessary if the performance impact is minor.

Yep, I think acquire-release is enough too.  So far this hasn't seemed hot
enough to worry yet, but we'll keep it in mind.  Thanks for thinking about it!

Powered by Google App Engine
This is Rietveld 408576698