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.

Show HN: uThreads – Concurrent User Threads in C and C++

135 pointsby saman_bover 8 years ago

10 comments

krat0sprakharover 8 years ago
This looks super interesting! I&#x27;ve been working on a Raytracer in C++ and I was recently looking into a threading library which I can use to parallelize the rendering. Surely going to try this out in the coming weekend.<p>Unsolicited suggestion - while benchmarks and the motivation are important for a threading library, a code snippet of a simple parallel program on the home page would be something that I&#x27;d love to see.<p>Great job, though!
评论 #12895241 未加载
评论 #12894837 未加载
评论 #12893750 未加载
jcbeardover 8 years ago
How would something like this differ from something like Sandia National Lab&#x27;s Qthreads (<a href="http:&#x2F;&#x2F;www.cs.sandia.gov&#x2F;qthreads&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.cs.sandia.gov&#x2F;qthreads&#x2F;</a>)? Seems it&#x27;s a tried and true solution in C that also works with C++11 (committed a test case for C++11 myself)...It is also an optional underpinning for some relatively big-name frameworks like Kokkos, Chapel, RaftLib, etc.
评论 #12898018 未加载
jtsylveover 8 years ago
Is there any reason you chose GPL3 or would you consider a less restrictive license like Apache or BSD?
评论 #12894790 未加载
评论 #12894744 未加载
评论 #12894799 未加载
michaelsbradleyover 8 years ago
For what kinds of applications would one favor this over, say, the coroutines approach of libdill?<p><a href="http:&#x2F;&#x2F;libdill.org&#x2F;tutorial.html" rel="nofollow">http:&#x2F;&#x2F;libdill.org&#x2F;tutorial.html</a><p>See, in particular, Step 6 of the tutorial.
评论 #12895638 未加载
anonymousDanover 8 years ago
Interesting, I&#x27;ve recently been looking for a user level threading package in C&#x2F;C++. I ended up settling on lthreads: <a href="http:&#x2F;&#x2F;lthread.readthedocs.io&#x2F;en&#x2F;latest&#x2F;intro.html" rel="nofollow">http:&#x2F;&#x2F;lthread.readthedocs.io&#x2F;en&#x2F;latest&#x2F;intro.html</a><p>Does anyone know how it compares?
评论 #12893520 未加载
评论 #12893493 未加载
purple-dragonover 8 years ago
I&#x27;ve had success with Intel&#x27;s Threading Building Blocks. Is there a reason I might prefer something like this instead?
评论 #12897746 未加载
medi11over 8 years ago
How does it compare to boost.fiber (<a href="http:&#x2F;&#x2F;www.boost.org&#x2F;doc&#x2F;libs&#x2F;1_62_0&#x2F;libs&#x2F;fiber&#x2F;doc&#x2F;html&#x2F;index.html" rel="nofollow">http:&#x2F;&#x2F;www.boost.org&#x2F;doc&#x2F;libs&#x2F;1_62_0&#x2F;libs&#x2F;fiber&#x2F;doc&#x2F;html&#x2F;ind...</a>)?
valarauca1over 8 years ago
Impressive.<p>8KiB stacks are a bit on the small side though for production usage. Go gets away with this because they&#x27;re stacks act more like Vectors then flat arrays.<p>Why did you decided to roll your own stack swapping software instead of using say using `boost::context`?
评论 #12894019 未加载
naaskingover 8 years ago
Why not just use StateThreads? A comparison against other options would be illuminating.
评论 #12895710 未加载
avdiciusover 8 years ago
I did something similar in plain C:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ademakov&#x2F;MainMemory" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ademakov&#x2F;MainMemory</a>