Re: [webkit-dev] PSA: you should use WTF::Lock and WTF::Condition instead of WTF::SpinLock, WTF::Mutex, WTF::ThreadCondition, std::mutex, std::condition_variable, or std::condition_variable_any

2015-08-23 Thread Filip Pizlo
Yes, I will need to implement some style rules! Here's the current status of the old concurrency primitives: ByteSpinLock and SpinLock: removed. Mutex and ThreadCondition: still in place because we have some code in older Safaris that expects these. I think we can remove ThreadCondition at

Re: [webkit-dev] PSA: you should use WTF::Lock and WTF::Condition instead of WTF::SpinLock, WTF::Mutex, WTF::ThreadCondition, std::mutex, std::condition_variable, or std::condition_variable_any

2015-08-22 Thread Darin Adler
Even if we remove the obsolete WTF classes, we might still want a checker rule about the ones in the std namespace. — Darin ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev

Re: [webkit-dev] PSA: you should use WTF::Lock and WTF::Condition instead of WTF::SpinLock, WTF::Mutex, WTF::ThreadCondition, std::mutex, std::condition_variable, or std::condition_variable_any

2015-08-21 Thread Maciej Stachowiak
On Aug 21, 2015, at 12:11 PM, Michael Catanzaro mcatanz...@igalia.com wrote: On Wed, 2015-08-19 at 13:08 -0700, Filip Pizlo wrote: TL;DR. Don’t use WTF::SpinLock, WTF::Mutex, std::mutex, WTF::ThreadCondition, std::condition_variable, or std::condition_variable_any. They waste CPU time

Re: [webkit-dev] PSA: you should use WTF::Lock and WTF::Condition instead of WTF::SpinLock, WTF::Mutex, WTF::ThreadCondition, std::mutex, std::condition_variable, or std::condition_variable_any

2015-08-21 Thread Rik Cabanier
Hi Filip, very interesting to see you change out such a fundamental algorithm! It's amazing that it works. Reading the code, it seems very comparable to Windows' critical sections [1]. Is that the case? Looking at github and msdn, 4000 seems to be the most common number of spins. I believe your

Re: [webkit-dev] PSA: you should use WTF::Lock and WTF::Condition instead of WTF::SpinLock, WTF::Mutex, WTF::ThreadCondition, std::mutex, std::condition_variable, or std::condition_variable_any

2015-08-21 Thread Michael Catanzaro
On Wed, 2015-08-19 at 13:08 -0700, Filip Pizlo wrote: TL;DR. Don’t use WTF::SpinLock, WTF::Mutex, std::mutex, WTF::ThreadCondition, std::condition_variable, or std::condition_variable_any. They waste CPU time and they waste memory. Use WTF::Lock and WTF::Condition instead. Hi, I recommend

[webkit-dev] PSA: you should use WTF::Lock and WTF::Condition instead of WTF::SpinLock, WTF::Mutex, WTF::ThreadCondition, std::mutex, std::condition_variable, or std::condition_variable_any

2015-08-19 Thread Filip Pizlo
Hi everyone, Over the past two weeks or so I’ve been doing some work to improve the locking primitives that we use in WebKit. These new primitives have landed, and they are simply called Lock and Condition. You should use Lock instead of SpinLock, Mutex, or std::mutex, because it combines