Answer the question
In order to leave comments, you need to log in
How to implement priority of asynchronous methods?
In general, there is a task to implement a statistics server. Suppose a couple of methods are implemented (writing data to the database, reading data and collecting statistics). So, how to implement the priority of methods, if you need to collect statistics in the first place? (That is, 100 requests came to write data, then one for collection. Let's say 10 asynchronous writes to the database are performed, a collection request comes in, we wait for the data to be written to the database, we receive data and send statistics, and only then continue recording)
Answer the question
In order to leave comments, you need to log in
Priority does not mean first priority. In real life, a long, high-priority process may well run longer (and finish later) than a low-priority one.
Accordingly, the task most likely implies something else, namely, "resolving" the sequence of execution of asynchronous processes. Accordingly, it is necessary to google semaphores, mutexes and queues.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question