Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, this has been done ad nauseam. Do you know why no one uses it? Reasoning about cooperative threads in C is impossible. Reasoning about async C code is impossible.


> Yes, this has been done ad nauseam. Do you know why no one uses it?

Yes.

> Reasoning about cooperative threads in C is impossible.

Well, sorta. The problem with these approaches is mostly that C runtimes expect you to use the native operating system thread construct, not your own handrolled thing. If you were writing a libc for your own operating system you could use something vaguely like these libraries.

Another obvious problem is the lack of utilization of multiple CPU cores. And once you try and mix the two (M:N threading), the system becomes difficult to understand (and often has worse performance than just 1:1 threading).

I wouldn't say it's because reasoning about them is impossible, but that in practice, they are extremely difficult to use.

> Reasoning about async C code is impossible.

No, that part isn't true.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: