b*e 发帖数: 3845 | 1 要实现一个类似Round Robin的分配系统。这个系统的背景是这样的,有n个Manager,设为
n1,n2,...,nn. 有m个tele-marketing people. Telemarketing
people打电话骚扰potential customer,如果对方中招,就通过一个Webpage
填入customer的信息,然后选一个manager,把这个customer的信息发给他(用JavaScript)
。
现在要求动态的根据manager的load自动选一个manager。算法很简单,比如说用一个queu
e,每次dequeue后,再insert到最后。我的问题是这样的系统怎么实现比较方便?以下是
我的一些想法,请教各位高手,有没有其他Architecture的可能?多谢。
1. 用Client-Server结构。Server will have a queue and is multi-threaded. It can
output to a queue file and read in the queue file.
Telemarketing的webpage可以 | f***o 发帖数: 31 | 2 you need a web server anyway;
one file is ok. use FileLock
【在 b*e 的大作中提到】 : 要实现一个类似Round Robin的分配系统。这个系统的背景是这样的,有n个Manager,设为 : n1,n2,...,nn. 有m个tele-marketing people. Telemarketing : people打电话骚扰potential customer,如果对方中招,就通过一个Webpage : 填入customer的信息,然后选一个manager,把这个customer的信息发给他(用JavaScript) : 。 : 现在要求动态的根据manager的load自动选一个manager。算法很简单,比如说用一个queu : e,每次dequeue后,再insert到最后。我的问题是这样的系统怎么实现比较方便?以下是 : 我的一些想法,请教各位高手,有没有其他Architecture的可能?多谢。 : 1. 用Client-Server结构。Server will have a queue and is multi-threaded. It can : output to a queue file and read in the queue file.
| b*e 发帖数: 3845 | 3 Thanks. One file is most simple solution.
I was just afraid of the read and write operation will be too slow
for another process to wait. Maybe the speed is still tolerable.
I will test it.
【在 f***o 的大作中提到】 : you need a web server anyway; : one file is ok. use FileLock
| s**********i 发帖数: 711 | 4
for such a small file it won't and shouldn't be any problem.
【在 b*e 的大作中提到】 : Thanks. One file is most simple solution. : I was just afraid of the read and write operation will be too slow : for another process to wait. Maybe the speed is still tolerable. : I will test it.
|
|