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

Issue 1594723003: New lock implementation for mac (Closed)

Created:
4 years, 11 months ago by tommi
Modified:
4 years, 11 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

New lock implementation for mac. According to my measurements, it's about 100x faster than the native mutex implementation in OSX. Google "OSX mutex performance" for more info. BUG= Committed: https://crrev.com/ed281e9c9b2fb8562fbfa9737e72ab7c5493722e Cr-Commit-Position: refs/heads/master@{#11352}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Add unit test and address some comments #

Patch Set 3 : Attempt to fix win build error #

Total comments: 6

Patch Set 4 : Rebase #

Patch Set 5 : Changed the test for more accuracy, fixed a bug, redid measurements #

Patch Set 6 : Disable the test again #

Patch Set 7 : Address comments #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+208 lines, -1 line) Patch
M webrtc/base/criticalsection.h View 1 2 3 2 chunks +21 lines, -0 lines 0 comments Download
M webrtc/base/criticalsection.cc View 1 2 3 4 5 6 5 chunks +79 lines, -1 line 4 comments Download
M webrtc/base/criticalsection_unittest.cc View 1 2 3 4 5 6 2 chunks +108 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (9 generated)
tommi
Hej Torbjorn - can you take a look? There might be alternate ways to go ...
4 years, 11 months ago (2016-01-19 00:25:14 UTC) #2
torbjorng (webrtc)
It is not clear to me that this is an improvement; but I wouldn't deny ...
4 years, 11 months ago (2016-01-20 15:46:43 UTC) #3
tommi
Add unit test and address some comments
4 years, 11 months ago (2016-01-21 14:53:01 UTC) #4
tommi
Added a test and wrote down some findings from running that test in the test ...
4 years, 11 months ago (2016-01-21 15:04:21 UTC) #5
tommi
oh and I also added a flag to make it easy to flip between the ...
4 years, 11 months ago (2016-01-21 15:04:47 UTC) #6
tommi
Attempt to fix win build error
4 years, 11 months ago (2016-01-21 15:10:15 UTC) #7
tommi
Rebase
4 years, 11 months ago (2016-01-21 16:37:28 UTC) #8
torbjorng (webrtc)
LGTM. Nice perf numbers, now I am convinced! https://codereview.webrtc.org/1594723003/diff/40001/webrtc/base/criticalsection.cc File webrtc/base/criticalsection.cc (right): https://codereview.webrtc.org/1594723003/diff/40001/webrtc/base/criticalsection.cc#newcode62 webrtc/base/criticalsection.cc:62: // ...
4 years, 11 months ago (2016-01-21 16:57:23 UTC) #9
tommi
Changed the test for more accuracy, fixed a bug, redid measurements
4 years, 11 months ago (2016-01-21 21:50:38 UTC) #10
tommi
Disable the test again
4 years, 11 months ago (2016-01-21 21:55:42 UTC) #12
tommi
Address comments
4 years, 11 months ago (2016-01-21 22:02:37 UTC) #13
tommi
https://codereview.webrtc.org/1594723003/diff/40001/webrtc/base/criticalsection.cc File webrtc/base/criticalsection.cc (right): https://codereview.webrtc.org/1594723003/diff/40001/webrtc/base/criticalsection.cc#newcode62 webrtc/base/criticalsection.cc:62: // operations, first a read-only one in order to ...
4 years, 11 months ago (2016-01-21 22:02:47 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1594723003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1594723003/120001
4 years, 11 months ago (2016-01-21 22:20:18 UTC) #16
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_arm64_rel on tryserver.webrtc (JOB_TIMED_OUT, no build URL) ...
4 years, 11 months ago (2016-01-22 00:20:34 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1594723003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1594723003/120001
4 years, 11 months ago (2016-01-22 07:46:09 UTC) #21
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 11 months ago (2016-01-22 07:47:28 UTC) #23
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/ed281e9c9b2fb8562fbfa9737e72ab7c5493722e Cr-Commit-Position: refs/heads/master@{#11352}
4 years, 11 months ago (2016-01-22 07:47:36 UTC) #25
joachim
Just driving by, nice change! Quick comment about comparing thread ids, not sure if really ...
4 years, 11 months ago (2016-01-22 08:35:38 UTC) #27
tommi
Thanks for taking a look joachim. https://codereview.webrtc.org/1594723003/diff/120001/webrtc/base/criticalsection.cc File webrtc/base/criticalsection.cc (right): https://codereview.webrtc.org/1594723003/diff/120001/webrtc/base/criticalsection.cc#newcode64 webrtc/base/criticalsection.cc:64: if (owning_thread_ != ...
4 years, 11 months ago (2016-01-22 08:51:59 UTC) #28
tommi
4 years, 11 months ago (2016-01-22 09:12:29 UTC) #29
Message was sent while issue was closed.
On 2016/01/22 08:51:59, tommi-webrtc wrote:
> Thanks for taking a look joachim.
> 
>
https://codereview.webrtc.org/1594723003/diff/120001/webrtc/base/criticalsect...
> File webrtc/base/criticalsection.cc (right):
> 
>
https://codereview.webrtc.org/1594723003/diff/120001/webrtc/base/criticalsect...
> webrtc/base/criticalsection.cc:64: if (owning_thread_ != self) {
> On 2016/01/22 08:35:38, joachim wrote:
> > Maybe change this to use "pthread_equal" to compare the thread ids.
> > 
> > According to the man page "The pthread_equal() function is necessary because
> > thread IDs should be considered opaque: there is no portable way for
> > applications to directly compare two pthread_t values."
> > 
> > However as this is MAC-only, you can probably keep it as-is.
> 
> Ah, thanks. I had meant to use PlatformThreadRef and IsThreadRefEqual from
> platform_thread.h.  I'll do a follow up cl even though this is ok for Mac.

https://codereview.webrtc.org/1619153003/

Powered by Google App Engine
This is Rietveld 408576698