Managing dynamic number of threads

前端 未结 3 473
北恋
北恋 2021-01-05 06:18

First of all, I\'m still familiarizing myself with multi-threading, and don\'t know much terminology. I need to make sure I\'m doing this right, because it\'s a sensitive su

3条回答
  •  盖世英雄少女心
    2021-01-05 06:58

    You can implement FreeNotify Message in your request queue and when Worker Thread receieve this message free themselves. In your example when you decrease number of threads from 5 to 3 just put 2 FreeNotify messages in your queue and 2 worker threads will be free.

提交回复
热议问题