12 threads with a lock were 231x slower than 1
Youtube
0:56
113 views
ZetBit
@UC3zY4m_LrHraxTCv-lFPPIg
Twelve threads added one to the same counter a million times each. Without protection I got between 1.1 and 2.2 million instead of 12 million. With a lock the answer was right, but it took 705 ms, while one thread doing all 12 million additions took 3 ms. Letting each thread count on its own and adding the results at the end took 1.5 ms.
More Videos

1:00
The Wee English Fella puts up his first Christmas tree 🎄
Alana & Josh
16 views

1:54
PINK FLOYD #genx #80s #80smusic #danregancomedy
Dan Regan Comedy
317 views

0:22
GTA 6 got people hoooooked mate
Pat Smith
1K views

2:24
Enough Resting! Time to Work! 😅👌
Alex & Annet 8K views

1:11
German Supermarkets will change you forever 🛒😏
Radical Living
19K views

0:36
library shennanigans
How To Kill An Hour
1K views