作者:手机用户2502880331 | 来源:互联网 | 2023-09-06 12:43
Myapplicationhasseveralworkers(workingondifferentthingsasdifferentprocesses)andsomeres
My application has several workers (working on different things as different processes) and some resources (working unit). Different workers need to process on all working unites. For example, I have workers like W1, W2 and W3, working unit U1 and U2. Then W1 needs to process U1 and U2, the same as W2 and W3. The restriction is different workers can not work on the same work unit at the same time.
我的应用程序有几个工作人员(作为不同的过程处理不同的东西)和一些资源(工作单元)。不同的工人需要处理所有的工作单位。例如,我有W1、W2和W3、工作单元U1和U2。然后W1需要处理U1和U2,就像W2和W3一样。限制是不同的工人不能同时在同一工作单位工作。
I have two designs and want to ask for advice which one is better.
我有两种设计,想咨询一下哪个更好。
- Push model: using a central job scheduler to assign work units to different workers, to ensure different workers are not working on the same work unit;
- 推模型:使用中央作业调度器将工作单元分配给不同的工作者,以确保不同的工作者不在同一工作单元工作;
- Pull model: each worker will ask a central job scheduler for work units to process, and job scheduler will select an appropriate work unit which is not being processed by other worker for the asking worker.
- 拉模型:每个工作者将要求一个中央作业调度器处理工作单元,而作业调度器将选择一个适当的工作单元,这个工作单元没有被其他工作者处理。
I want to know the pros and cons of each design. And one of my major concerns is about -- finding a loosely coupled design (it is one of my major goal, but not the only goal). I am not sure whether push model or poll model has better extensibility (option 1 is more loosely coupled)?
我想知道每个设计的利弊。我最关心的一个问题是——找到一个松散耦合的设计(这是我的主要目标之一,但不是唯一的目标)。我不确定push模型或poll模型是否具有更好的可扩展性(选项1更松散耦合)?
thanks in advance, George
提前谢谢,乔治
2 个解决方案