[zeromq-dev] Fair client queue
jesper at aino.se
Thu Feb 2 16:52:58 CET 2012
I'm trying to create a parallel task system. Tasks are initiated by and
owned by a user. The divide and conquer example from the guide doesn't
quite do it because if we have one user pushing loads of tasks, anyone
pushing a task after him would have to wait until all his jobs are finished.
The goal is that tasks should be pulled fairly per user/client. I've
created a diagram of what I think is a solution to this, but it doesn't
feel optimal. I have roughly this diagram in code as well and it's working
OK. Check the link below!
The idea is that users push tasks to my client starter. The client starter
then forwards these tasks to client threads (these are created if initially
not existing and times out /stops if there's nothing to do for a while..)
who then sends them to workers, one at a time by REQ. Actually, the only
reason I do REQ here is because I don't want a client thread having more
than one task being worked one. I'm not sure this is the best way to
achieve fair client tasks..
Any suggestions/guidelines highly appreciated!
If you would like to view my diagram in Google docs, use this link:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the zeromq-dev