2 ms·
To be honest, most people writing threaded code just let the 5 tasks run serially. Otherwise they would have the problem you mentioned.
by anonymoushn 6y ago
To be honest, most people writing threaded code just let the 5 tasks run serially. Otherwise they would have the problem you mentioned.
- arethuza 6y agoIf there are dependencies between those tasks (i.e. task 2 depends on the result of task 1, task 3 depends on the result of task 2...) what option do you have? And if there aren't dependencies better to drop messages on a queue and have a completely different process handle those tasks.
- anonymoushn 6y agoIdeally, the tasks would be serialized when dependent on each other and not when not dependent on each other. Dropping them on a queue discards information about the caller, which is what this thread of the discussion is about. Using greenlet or async/await, you can serialize only when necessary and retain information about the caller.