News for hackers. Stuff that matters.
Re:Go-style concurrency in C by Animats on Wednesday November 18, 2015 @12:26AM (#10586084)
What happens when something blocks for synchronous I/O?
Re:Go-style concurrency in C by rumcajz on Wednesday November 18, 2015 @01:01AM (#10586221)
A different coroutine gets a go.
Re:Go-style concurrency in C by rdtsc on Wednesday November 18, 2015 @01:54AM (#10586379)
But only if it is using the aproved I/O socket operations from the library. What if it uses an operation from a regular socket librayr or if it runs a for loop or some CPU bound computation?
Re:Go-style concurrency in C by rumcajz on Wednesday November 18, 2015 @03:14AM (#10586581)
when using native i/o take care to use it in nonblocking manner. if it would block use libmill's fdwait() to wait while the file descriptor is unblocked. in case of long computations call yield() once in a while to give other coroutines a chance to run.
Re:Go-style concurrency in C by Animats on Wednesday November 18, 2015 @01:30AM (#10586316)
How do they do that? Their own I/O library with asynchronous everything?
Re:Go-style concurrency in C by rumcajz on Wednesday November 18, 2015 @01:32AM (#10586321)
Simple stack switching. See here for a toy example: http://250bpm.com/blog:48
Re:Go-style concurrency in C by cthrowago on Wednesday November 18, 2015 @01:41AM (#10586351)
Yes.