mirror of
https://github.com/logos-storage/das-research.git
synced 2026-05-04 16:43:15 +00:00
use shuffled round robin between output queues
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com> # Conflicts: # DAS/validator.py
This commit is contained in:
parent
d20d8c7c3c
commit
31b7a5ecea
@ -274,10 +274,8 @@ class Validator:
|
|||||||
reality of libp2p implementations where topics between two nodes are
|
reality of libp2p implementations where topics between two nodes are
|
||||||
multiplexed over the same transport.
|
multiplexed over the same transport.
|
||||||
"""
|
"""
|
||||||
progress = True
|
|
||||||
while (progress):
|
|
||||||
progress = False
|
|
||||||
|
|
||||||
|
def activeSendQueues():
|
||||||
queues = []
|
queues = []
|
||||||
# collect and shuffle
|
# collect and shuffle
|
||||||
for rID, neighs in self.rowNeighbors.items():
|
for rID, neighs in self.rowNeighbors.items():
|
||||||
@ -290,14 +288,27 @@ class Validator:
|
|||||||
if (neigh.sendQueue):
|
if (neigh.sendQueue):
|
||||||
queues.append((1, cID, neigh))
|
queues.append((1, cID, neigh))
|
||||||
|
|
||||||
for dim, lineID, neigh in shuffled(queues, self.shuffleQueues):
|
return queues
|
||||||
if dim == 0:
|
|
||||||
self.checkSendSegmentToNeigh(lineID, neigh.sendQueue.popleft(), neigh)
|
progress = True
|
||||||
else:
|
while (progress):
|
||||||
self.checkSendSegmentToNeigh(neigh.sendQueue.popleft(), lineID, neigh)
|
|
||||||
progress = True
|
if hasattr(self, 'activeSendQueues'):
|
||||||
if self.statsTxInSlot >= self.bwUplink:
|
progress = False
|
||||||
return
|
for dim, lineID, neigh in self.activeSendQueues:
|
||||||
|
if dim == 0:
|
||||||
|
self.checkSendSegmentToNeigh(lineID, neigh.sendQueue.popleft(), neigh)
|
||||||
|
else:
|
||||||
|
self.checkSendSegmentToNeigh(neigh.sendQueue.popleft(), lineID, neigh)
|
||||||
|
progress = True
|
||||||
|
if self.statsTxInSlot >= self.bwUplink:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.activeSendQueues = activeSendQueues()
|
||||||
|
if self.activeSendQueues:
|
||||||
|
self.activeSendQueues = shuffled(activeSendQueues(), self.shuffleQueues)
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
|
||||||
def runSegmentShuffleScheduler(self):
|
def runSegmentShuffleScheduler(self):
|
||||||
""" Schedule chunks for sending.
|
""" Schedule chunks for sending.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user