I have a concrete problem that in a higher level language I would solve using async/await: we have a blocking system/hardware communication/network call that takes several seconds to complete. We would like to have that happen in the background while we do some other of such calls in parallel.
I have thought of a couple of solutions and there might be better ones than these:
start a thread and signal condition variable/semaphore once it's done;
provide a callback that is executed when the call finishes (old JavaScript style);
create your own custom scheduler to actually mimic async/await.
What's the ideal solution to this in a systems language such as Odin or C?