Interesting, I've recently been looking for a user level threading package in C/C++. I ended up settling on lthreads: http://lthread.readthedocs.io/en/latest/intro.html Does anyone know how it compares?
Hi, I developed uThreads. I looked at lthreads quickly, and it seems lthreads only maps multiple coroutines onto a single pthread (N:1). Although, it adds the possibility of running multiple pthreads, but each pthread can only run their local lthreads (using M threads that do N:1 mapping). However, in uThreads, uThreads can be multiplexed over multiple pthreads (thus M:N mapping). Also lthreads scheduler is based on…
Show HN: uThreads – Concurrent User Threads in C and C++
11–20 of 64 posts
Re: Show HN: uThreads – Concurrent User Threads in C and C++
#12Earlier quoted context omitted.
Thanks! good point; now that I look at the page, there is not a single sample code in there. I'll update it soon.
Awesome! As an example, Rayon[0] does a very good job (IMHO) at this. [0] - https://github.com/nikomatsakis/rayon
There is no fork-and-join in uThreads yet, and I created it using create and join. The interface will improve in the future :)
Re: Show HN: uThreads – Concurrent User Threads in C and C++
#13Re: Show HN: uThreads – Concurrent User Threads in C and C++
#14Impressive. 8KiB stacks are a bit on the small side though for production usage. Go gets away with this because they're stacks act more like Vectors then flat arrays. Why did you decided to roll your own stack swapping software instead of using say using `boost::context`?
Right, however segmented stacks are have high overhead and stack copying is not very easy in C/C++. Thus, for now uThreads only support fixed size stacks, I know it makes it harder to be used in production, and in the future I might provide optional segmented stacks. As for why not using `boost::context`, I am implementing uThreads as part of my research in uwaterloo, I wanted to have full control over the code and b…
you're all idiots.
Re: Show HN: uThreads – Concurrent User Threads in C and C++
#15Is there any reason you chose GPL3 or would you consider a less restrictive license like Apache or BSD?
Sorry if this sounds snarky, and I do not blame you in particular, but it is just a theme I have encountered here the last years that I find toxic as it portrays the GPL (and FSF) as some evil organization that would restrict "developer's rights".
Re: Show HN: uThreads – Concurrent User Threads in C and C++
#16Is there any reason you chose GPL3 or would you consider a less restrictive license like Apache or BSD?
Can we please stop calling out nearly every project that uses GPL (3) and call it restrictive? I know there are different opinions and arguing which is "better" nearly always leads to a philosophical debate on principles that gets us nowhere. Sorry if this sounds snarky, and I do not blame you in particular, but it is just a theme I have encountered here the last years that I find toxic as it portrays the GPL (and FS…
"Hi, I'd like to use your library, but your license is incompatible with the other licenses in my codebase. Consider BSD please?"
Re: Show HN: uThreads – Concurrent User Threads in C and C++
#17Is there any reason you chose GPL3 or would you consider a less restrictive license like Apache or BSD?
Re: Show HN: uThreads – Concurrent User Threads in C and C++
#18Is there any reason you chose GPL3 or would you consider a less restrictive license like Apache or BSD?
Re: Show HN: uThreads – Concurrent User Threads in C and C++
#19This looks super interesting! I'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. 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'd love to see…
Re: Show HN: uThreads – Concurrent User Threads in C and C++
#20Earlier quoted context omitted.
Can we please stop calling out nearly every project that uses GPL (3) and call it restrictive? I know there are different opinions and arguing which is "better" nearly always leads to a philosophical debate on principles that gets us nowhere. Sorry if this sounds snarky, and I do not blame you in particular, but it is just a theme I have encountered here the last years that I find toxic as it portrays the GPL (and FS…
Not sure what the OP's motivation are for asking "why GPL?", but my motivation when I ask that can translate to something like this: "Hi, I'd like to use your library, but your license is incompatible with the other licenses in my codebase. Consider BSD please?"