(no title)
lvkv | 2 years ago
Deadlocks are still possible when using fibers backed by a single thread if you serialize your fiber execution. Here’s an example I’ve seen in the wild:
Imagine a serialized job server implemented with fibers that, when closed, waits for all jobs to finish by posting a final bookend job and waiting for it to finish. This works, unless you decide to close the server inside one of your serialized jobs—you’ve now created a deadlock where your job server is waiting for itself to finish closing.
I’m sure an N:1 deadlock is also possible without serialization, but I can only think of contrived examples.
No comments yet.