News for hackers. Stuff that matters.
Re:Mill: Go-style concurrency in C by davidw on Friday May 01, 2015 @07:33AM (#9470648)
How's it work under the hood?
Re:Mill: Go-style concurrency in C by mikepurvis on Friday May 01, 2015 @10:58AM (#9471792)
Re:Mill: Go-style concurrency in C by a1k0n on Friday May 01, 2015 @03:23PM (#9473909)
And computed gotos, which just jumps to a pointer, which is a gcc extension. That's totally crazy, but sort of awesome.
Re:Mill: Go-style concurrency in C by smegel on Friday May 01, 2015 @07:37AM (#9470660)
Getcontext/setcontext has always allowed for coroutines in C. This just adds a sugar layer of nonblocking functions that allows a runtime layer to switch between contexts (coroutines), just like Go.
Re:Mill: Go-style concurrency in C by octetta on Friday May 01, 2015 @09:30AM (#9471117)
The ucontext stuff is nice but why was it deprecated?

It's generally not a problem on x86, but in my experience for other platforms, it gets messy quickly.

It would be nice if a replacement or a "de-deprecated" was around.

Re:Mill: Go-style concurrency in C by Blackthorn on Friday May 01, 2015 @11:27AM (#9472039)
That question has seriously bothered me too. OS threads are not a replacement as they are preemptive. The deprecation was way premature.
Re:Mill: Go-style concurrency in C by tedunangst on Friday May 01, 2015 @05:52PM (#9474759)
makecontext cannot be correctly represented by the C type system.
Re:Mill: Go-style concurrency in C by frankerz on Friday May 01, 2015 @09:59AM (#9471276)
I'm not very good at C, but from my understanding this library uses longjmp functions which means it's cooperative multithreading rather than preemptive isn't it?
Re:Mill: Go-style concurrency in C by rumcajz on Friday May 01, 2015 @10:07AM (#9471327)
correct
Re:Mill: Go-style concurrency in C by rumcajz on Friday May 01, 2015 @07:37AM (#9470662)
Here's a short toy implementation of the same principle: http://250bpm.com/blog:48