3 ms·
Yes I understand the difference between threads and fibers. That is a much different conversation than "All functions async by default and preemptible."
by eweise 4y ago
Yes I understand the difference between threads and fibers. That is a much different conversation than "All functions async by default and preemptible."
- cube2222 4y agoIf you run non-async (blocking) code in a fiber, then it will block the underlying OS thread. Functions need to be compiled in a special way and use IO in a very specific way (async io) in order for them to be properly runnable by fibers. This specific way is commonly referred to as "async", or "nonblocking", and all functions in Go are that way, including all IO functions available in the stdlib.