Depending on how deep you want to go, you may find this article interesting. Basically, to @Avi 's point:

Asynchronous I/O goes hand-in-hand with event notification .

The problem to be solved is how to receive notification of asynchronous events in a synchronous manner, so that a program can usefully deal with those events. With the exception of signals, asynchronous events do not cause any immediate execution of code within the application; so, the application must check for these events and deal with them in some way.

What happens when an IO event occurs and your Task's continuation needs to be executed?

It can't just run - it needs to run on some thread, but which thread? And is that thread even capable of interrupting whatever it is doing to start processing the event? And which functions are safe to use while processing that event? Remember that we just interrupted the thread, so we may be invoking functions reentrantly.

Generally there are 2 ways to handle that:

  • Polling (or blocking while waiting for events) on some dedicated thread, which can then process them in a straightforward manner, or
  • Signals, which will interrupt the thread in order to invoke a custom signal-handler.

For Swift's concurrency model, neither of these are ideal. A suspending call will have a continuation, and we'd really want to enqueue that continuation on the appropriate executor when the event is triggered.

In theory, we could do that by install a signal handler which maintains a list of (executor, continuation) pairs (possibly including other flags which affect how the executor schedules the job on the thread/s it manages, such as priority). However, I don't think we have public APIs in the standard library to do that yet, and I don't believe it is specified whether the existing implementations are signal-safe.