TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Lock-Free Data Structures: Exploring Queues

43 pointsby skazka16about 10 years ago

2 comments

cjensenabout 10 years ago
One thing I&#x27;ve learned about lock-free structures: DWCAS[1] is your friend. Using DWCAS, the Michael and Scott Queue algorithm is trivial to implement. Not really sure why the author insists on using plain CAS, especially when implementing a DWCAS-based algorithm.<p>[1] <a href="http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Double_compare-and-swap" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Double_compare-and-swap</a>
评论 #9501456 未加载
评论 #9501461 未加载
ccrolfabout 10 years ago
This seems very (very) strange to me. Did a simplified mockup in Java using a ConcurrentLinkedDeque. Got an absolute speed-up of ~8 going from 1 thread to 2 (or 4)...and that&#x27;s on a laptop. Did you perhaps measure CPU time rather than wall clock or push entries scaled by the number of threads? Didn&#x27;t find your test source on GitHub..