Better HN
topnewbestaskshowjobs
Log inSign up

phabouzit

1 karma · joined May 10, 2016 (10y ago) · 3 submissions

Submissions

comment 10y ago · link · parent

1) indeed there are a couple of barriers that could be optimized

2) in addition to what Phil already said (which is that there's no priority inversion for Safari/WebKit to have as all threads taking these locks have the same priority to boot), the private lock you're talking about, named the handoff lock, has terrible unlock patterns, and is why it performs so poorly when WTF::Lock benched it.

comment 10y ago · link · parent

I disagree strongly as too strong barriers on non TSO hardware (such as say, armv7 or armv8) will just cause even more of that memory contention for no good reasons.

Also on a contended lock, there's a very strong possibility that you will decide that the lock can be taken right before you block.

On intel of course, it doesn't matter.

comment 10y ago · link · parent

Which OS X Release? with which benchmark? uncontended pthread_mutex was made significantly faster in OS X El Capitan (almost twice as fast as before), and on my own mac is only twice as slow as OSSpinLock, and OSSpinLock unlock is a store(lock, 0), where a mutex usually need an xchg or cmpxchg which amount for most of the 2x performance loss.

I very very much doubt that linux implementation is that different (I'm actually fairly confident pthread_mutex on linux and OS X El Capitan+ are mostly on par)