Shu Ming has posted comments on this change.
Change subject: Adding threads limitation to misc.tmap
......................................................................
Patch Set 2: I would prefer that you didn't submit this
(2 inline comments)
....................................................
Commit Message
Line 8:
Line 9: Using threads queue to keep the threads order and limit threads count
Line 10:
Line 11: I moved the function code next to itmap for readability.
Line 12: Currently noone calls to tmap function, so I don't care to change and
tmap--->tmap()
Line 13: fix it now to avoid future bugs.
Line 14:
Line 15: Exceptions that related to the queue usage will be raised as part of
Line 16: the function's exceptions.
....................................................
File vdsm/storage/misc.py
Line 1227: if maxthreads < 1 and maxthreads != UNLIMITED_THREADS:
Line 1228: raise ValueError("Wrong input passed to function tmap: %s",
maxthreads)
Line 1229:
Line 1230: resultsDict = {}
Line 1231: error = [None]
I am not sure if we need a list here for error. In the code below, only e[0]
is referenced. Why not make it a simple variable?
Line 1232:
Line 1233: def wrapper(f, arg, index):
Line 1234: try:
Line 1235: resultsDict[index] = f(arg)
--
To view, visit http://gerrit.ovirt.org/8858
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I07845bfd78b9215e8994ac2ebe46a7ff78c85625
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: Shu Ming <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches