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

Check out lthread_compute_begin() and lthread_compute_end() functions. It allows you to block inside a coroutine without affecting other coroutines. (example at the end of the page)

I prefer coroutines over IO loops because they result in simpler and cleaner code. And with lthread_compute feature, you get the advantages of real threads + the lightness of coroutines.

https://github.com/halayli/lthread



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: