Zhou Zheng Sheng has posted comments on this change.
Change subject: Adding threads limitation to misc.tmap
......................................................................
Patch Set 7: (1 inline comment)
....................................................
File vdsm/storage/misc.py
Line 1097: if maxthreads < 1 and maxthreads != UNLIMITED_THREADS:
Line 1098: raise ValueError("Wrong input passed to function tmap: %s",
maxthreads)
Line 1099:
Line 1100: resultsDict = {}
Line 1101: tmap.error = None
Both ways are good. I like the list trick, it's concise, just needs a small
piece of comment, such as "# a trick for enabling wrapper write to the error
variable in outer namespace"
Can you use "resultsDict['error']" to store the error, then you can get rid of
the list, and there will be no need for extra comment.
Line 1102:
Line 1103: def wrapper(f, arg, index):
Line 1104: try:
Line 1105: 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: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: ShaoHe Feng <[email protected]>
Gerrit-Reviewer: Shu Ming <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches