tikv / yatp

Yet another thread pool in rust for both callbacks or futures.
Apache License 2.0
135 stars 32 forks source link

support multi-level feedback queue scheduling algorithm #13

Closed sticnarf closed 4 years ago

sticnarf commented 4 years ago

In some cases, we want to lower the priority of long-running tasks, (especially for CPU bound tasks). We can implement a task queue with multi-level feedback queue scheduling algorithm to solve the problem.

The queue itself cannot solve the whole problem. Unlike languages with runtime like Go, here we need task itself to interrupt itself give back the controllership to the thread pool. We should also provide a convenient way for Futures to interrupt itself once.

sticnarf commented 4 years ago

Closed by #15