I
I
ilionis2017-02-26 10:02:22
C++ / C#
ilionis, 2017-02-26 10:02:22

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

2 answer(s)
D
d-stream, 2017-02-26
@ilionis

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.

T
tex0, 2017-02-26
@tex0

smoke System.Threading.Tasks.Task

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question