3 ms·
Thanks!
by halayli 15y ago
Thanks!
- willvarfar 15y agoVery nice :) http://williamedwardscoder.tumblr.com/post/17112393354/a-solution-to-cpu-intensive-tasks-in-io-loops http://williamedwardscoder.tumblr.com/post/17112393354/a-sol... might be an interesting distraction ;)
- halayli 15y agoI am against IO event loops :). Scroll down to the bottom of the README and look for fibonacci(35) to see how I solve the problem mentioned in the link. The example is a naive HTTP server that computes fibonacci on every request and replies back.
- willvarfar 15y agoYes I saw before I posted :) You move it explicitly to its own thread. What would happen if you didn't do that? My article is applicable to `lthread` too. Its a discussion about what happens to fib(35) or any blocking task running in a multiplexing-tasks-in-a-thread setup really.
- halayli 15y agoWhat happens is that it will block the other lthreads, bringing down the RPS to its knees. lthreads are simply coroutines and cooperation/trust are required to maintain fairness.