Hi! This library looks really great and I'm considering to include it into a new project. However I have a theory question I'd like to get an answer to before doing that. I was wondering if the following scenario was possible:
async something, which gets executed in the "async" concurrent queue, which runs in thread A.
- Inside thread A you
await for something, which locks thread A, and that something runs on thread B.
- On thread B something else is awaited, which causes thread B to be locked as well, and that something is dispatched to the "async" concurrent queue. Then, GCD chooses thread A to run that, either because it ran out of threads from its internal thread pool, or because it assumes it will unlock eventually, continuing with the dispatched block after that happens.
- Thread B will be awaiting for something that got dispatched to thread A (the last awaited
async block), but thread A is also awaiting for thread B to resolve its promise. Then there's a deadlock and there's no way of getting out of it.
Thank you in advance, and as I'm sure something like StackOverflow would be better to ask this kind of questions, I also know there's no better person to answer it than the creator of the framework himself.
Hi! This library looks really great and I'm considering to include it into a new project. However I have a theory question I'd like to get an answer to before doing that. I was wondering if the following scenario was possible:
asyncsomething, which gets executed in the "async" concurrent queue, which runs in thread A.awaitfor something, which locks thread A, and that something runs on thread B.asyncblock), but thread A is also awaiting for thread B to resolve its promise. Then there's a deadlock and there's no way of getting out of it.Thank you in advance, and as I'm sure something like StackOverflow would be better to ask this kind of questions, I also know there's no better person to answer it than the creator of the framework himself.