mldonkey-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-users] [New queue system] request for help.


From: Fortin Denis
Subject: [Mldonkey-users] [New queue system] request for help.
Date: 12 Jun 2003 22:00:43 +0200

Hi!

I started working on a new queueing system but now i'm stuck because of
design issues. b8_bavard, simon and others can you help me?
Here some ideas i would to achieve :
-High modularity
-Fairness
-Possibility of priorities

So here's my work so far :
I created a class qoq (are objects accepted in mldonkey?) which is a
'queue of queue'.
it is parametrized by something like this : max_number_of clients *
[hash_function_1,tag_1;hash_function_2,tag_2...]. (tag may be used to
prioritize)
Each time a client enter the queue it will be hashed with
hash_function_1 to 'classify' it in a subqueue (which will classify it
with hash_function_2).
For example with [hash_net,"net";hash_file,"file"] (and maybe in a not
so distant future hash_mldonkey_user :-) ):
a client from edonkey want file 1 enter ->

[########               [########
edonkey  |100%|  ---->   file 1 |100%| -----> fifo
#########]               ########]

a client from edonkey want file 2 enter ->

[########             [########
edonkey |100%|   ---->   file 1 |50%|   ----> fifo
#########]             file 2 |50%|   ----> fifo
                      ########]

a client from FT want file 3 enter ->

[########                [########
edonkey |50%|   ---->       file 1 |50%|    ----> fifo
FT      |50%|   -|          file 2 |50%|   ----> fifo
#########]       |        ########]  
                 |
                 |____> [########
                          file 3   |100%| -----> fifo                           
########]       


and so on...
While poping a client from queue to uploaders each queue as a
probability of |x%| to be choosed.
I'm stuck in the 'pop' method (see first comment in joined file )part
and i think the code is now to big and have too many variables to be
efficient enough (or even usable).
So i would like some advice from ocaml pro-coders (stop using objects,
using lists instead of arrays...).


By the way it's probably time to tell me if you want a feature that's
currently impossible to implement with this kind of queue.



PS: Sorry g2-gui team for not helping for the moment but i think it's
important for mldonkey to be a fair uploader (at least between networks)
-- 
Fortin  Denis (HighTime) <address@hidden>

Attachment: q3.ml
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]