Francesco Romani has posted comments on this change. Change subject: lib: Simplify and generalize concurrent.tmap() ......................................................................
Patch Set 2: Code-Review+1 (1 comment) This patch makes the code nicer. But I'm not sure about the longer term direction. https://gerrit.ovirt.org/#/c/38465/2/lib/vdsm/concurrent.py File lib/vdsm/concurrent.py: Line 36: results[i] = Result(False, e) Line 37: Line 38: threads = [] Line 39: for i, arg in enumerate(args): Line 40: t = threading.Thread(target=worker, args=(i, func, arg)) let me stress again that I'm ok with this patch. This is just a general observation, which we may want to move on the ML. So we basically fire up and shut down a tailor-made thread pool for each invocation. This is not the best practice even when threads aren't crippled as they are in CPython. For future patch/discussion: what about having a generic thread pool (maybe an Executor) and just adding utilities like this one on top of it? Line 41: t.daemon = True Line 42: t.start() Line 43: threads.append(t) Line 44: -- To view, visit https://gerrit.ovirt.org/38465 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4337db65fe1b326157507b1424a8b4924b91210f Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer <[email protected]> Gerrit-Reviewer: Allon Mureinik <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: Yaniv Bronhaim <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
