Fix performance issue when compiling. (#8828)

* Fix performance issue when compiling.

Spack was doing active wait when compiling, spoiling one core.
My fix consists in not setting any timeout for select, instead of
the previous 0 second.

* Fix comments about select.select timeout
This commit is contained in:
cedricchevalier19 2018-08-07 18:13:07 +02:00 committed by Todd Gamblin
parent 79e7359f4d
commit 3301e21f06

View File

@ -446,10 +446,9 @@ def _writer_daemon(self, stdin):
try:
with keyboard_input(stdin):
while True:
# Without the last parameter (timeout) select will
# wait until at least one of the two streams are
# ready. This may cause the function to hang.
rlist, _, xlist = select.select(istreams, [], [], 0)
# No need to set any timeout for select.select
# Wait until a key press or an event on in_pipe.
rlist, _, _ = select.select(istreams, [], [])
# Allow user to toggle echo with 'v' key.
# Currently ignores other chars.