2 ms·
OS threads cost you stack space, among other things. There's a reason that most OS native UI frameworks use some sort of event polling structure(WNDPROC[1], Lo
by vvanders 6y ago
OS threads cost you stack space, among other things.
There's a reason that most OS native UI frameworks use some sort of event polling structure(WNDPROC[1], Looper/Handler[2], etc) because they're a nice structure for efficient handling of events. Tokio lets you do that across a diverse of events and get the same type of savings.
[1] https://en.wikipedia.org/wiki/Message_loop_in_Microsoft_Windows https://en.wikipedia.org/wiki/Message_loop_in_Microsoft_Wind...
[2] https://developer.android.com/reference/android/os/Looper https://developer.android.com/reference/android/os/Looper