Ensuring task execution order in threadpool

后端 未结 17 992
情深已故
情深已故 2020-12-12 11:54

I have been reading about the thread-pool pattern and I can\'t seem to find the usual solution for the following problem.

I sometimes want tasks to be executed serial

17条回答
  •  旧时难觅i
    2020-12-12 12:38

    How would you ensure those tasks are ordered?

    push task1
    push task2
    push task346
    push task5
    

    In response to the edit:

    push task1
    push task27   **
    push task3468   *
    push task5
    push task9
    

提交回复
热议问题