3 ms·
I think function colouring is a positive thing. A synchronous function cannot yield; so calling an asynchronous function from it doesn't make sense since those
by qqssccfftt 6y ago
I think function colouring is a positive thing. A synchronous function cannot yield; so calling an asynchronous function from it doesn't make sense since those cannot yield either.
- notacoward 6y agoA synchronous function cannot yield, but it can make sure another thread is available to take its place before it issues a blocking syscall. If properly constructed, synchronous stdlib functions would be safe to call from async functions. Any "executor" implementation that uses a fixed-size thread pool and is vulnerable to all threads in that pool being tied up this way at once is BROKEN.