Task execution method and device based on thread pool

The invention provides a task execution method and device based on a thread pool. The method comprises: receiving a first task request; judging whether a second task list is contained in a first cache or not based on the first task request, wherein the second task list comprises a second task discar...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: WU CHENGLONG, XU KEBAO, SHI SHENGSHEN, YANG PENGYU
Format: Patent
Sprache:chi ; eng
Schlagworte:
Online-Zugang:Volltext bestellen
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:The invention provides a task execution method and device based on a thread pool. The method comprises: receiving a first task request; judging whether a second task list is contained in a first cache or not based on the first task request, wherein the second task list comprises a second task discarded by the thread pool; if yes, judging whether the blocking queue is full or not; and if not, providing a second task list in a first cache to the blocking queue, and emptying the second task list in the first cache. According to the method, the second task which is originally discarded according to the saturation strategy is stored in the third-party cache middleware, when a new first task request comes, the first task is not directly processed, but the second task which is discarded by executing the saturation strategy before is processed, so that compensation calling of the lost task is carried out, the possibility of task loss under the condition that the bearing capacity of the system is not allowed is avoide