- Mastering Node.js(Second Edition)
- Sandro Pasquali Kevin Faaborg
- 269字
- 2021-07-02 19:28:42
Collaboration
What would be preferable to the blocking system described previously is a collaborative work environment, where workers are regularly assigned new tasks to do, instead of idling. In order to achieve such a goal, what we need is a virtual switchboard, where requests for services are dispatched to available workers, and where workers notify the switchboard of their availability.
One way to achieve this goal is to have a pool of available labors, improving efficiency by delegating tasks to different workers as the tasks come in:

One drawback to this method is the amount of scheduling and worker surveillance that needs to be done. The dispatcher must field a steady stream of requests, while managing messages coming from workers about their availability, neatly breaking up requests into manageable tasks and efficiently sorting them, so that the fewest number of workers are idling.
Perhaps most importantly, what happens when all workers are fully booked? Does the dispatcher begin to drop requests from clients? Dispatching is resource-intensive as well, and there are limits even to the dispatcher's resources. If requests continue to arrive and no worker is available to service them, what does the dispatcher do? Manage a queue? We now have a situation where the dispatcher is no longer doing the right job (dispatching), and has become responsible for bookkeeping and keeping lists, further extending the time each task takes to complete. Each task takes some amount of time, and must be processed in arrival order. This task execution model stacks fixed time intervals — ticks of time. This is synchronous execution.
- 黑客攻防實(shí)戰(zhàn)技術(shù)完全手冊(cè):掃描、嗅探、入侵與防御
- 物聯(lián)網(wǎng)與北斗應(yīng)用
- TCP/IP入門經(jīng)典(第5版)
- 物聯(lián)網(wǎng)概論(第2版)
- 網(wǎng)絡(luò)安全技術(shù)與解決方案(修訂版)
- Building RESTful Web Services with Spring 5(Second Edition)
- 計(jì)算機(jī)網(wǎng)絡(luò)與通信(第2版)
- 智慧光網(wǎng)絡(luò):關(guān)鍵技術(shù)、應(yīng)用實(shí)踐和未來演進(jìn)
- 網(wǎng)絡(luò)環(huán)境中基于用戶視角的信息質(zhì)量評(píng)價(jià)研究
- 物聯(lián)網(wǎng)頂層設(shè)計(jì)與關(guān)鍵技術(shù)
- 高級(jí)網(wǎng)絡(luò)技術(shù)
- 轉(zhuǎn)化:提升網(wǎng)站流量和轉(zhuǎn)化率的技巧
- 現(xiàn)場(chǎng)綜合化網(wǎng)絡(luò)運(yùn)營(yíng)與維護(hù):運(yùn)營(yíng)商數(shù)字化轉(zhuǎn)型技術(shù)與實(shí)踐
- 移動(dòng)互聯(lián)網(wǎng)環(huán)境下的核心網(wǎng)剖析及演進(jìn)
- 通信系統(tǒng)實(shí)戰(zhàn)筆記:無處不在的信號(hào)處理