diff options
author | Karel Kočí <cynerd@email.cz> | 2015-08-26 19:15:02 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-08-26 19:25:01 +0200 |
commit | 59a1d7d09796a3f38fe036a9a673ce29876d3420 (patch) | |
tree | e92d99199be66d5d389560a6d1f4bb418f94f150 /scripts | |
parent | 07fdad8a1834a84a476faf0b9ca9b817263cf3ec (diff) | |
download | linux-conf-perf-59a1d7d09796a3f38fe036a9a673ce29876d3420.tar.gz linux-conf-perf-59a1d7d09796a3f38fe036a9a673ce29876d3420.tar.bz2 linux-conf-perf-59a1d7d09796a3f38fe036a9a673ce29876d3420.zip |
Add print to signal thread start and stop in multithread mode
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/loop.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/loop.py b/scripts/loop.py index f4a37a2..70004d5 100755 --- a/scripts/loop.py +++ b/scripts/loop.py @@ -49,13 +49,14 @@ def measure(kernelimg, con): print("Configuration '" + con.hash + "' measured.") # Multithread # -__conflist__ = set() +__conflist__ = [] __listlock__ = Lock() class prepareThread(Thread): def __init__(self, name='prepare'): Thread.__init__(self, name=name) def run(self): + print('Prepare thread start') __listlock__.acquire() while not __terminate__ and len(__conflist__) <= conf.multithread_buffer: __listlock__.release() @@ -64,15 +65,17 @@ class prepareThread(Thread): except exceptions.NoApplicableConfiguration: return __listlock__.acquire() - __conflist__.add((img, config)) + __conflist__.append((img, config)) if not __measurethread__.isActive(): __measurethread__.start() __listlock__.release() + print('Prepare thread stop') class measureThread(Thread): def __init__(self, name='measure'): Thread.__init__(self, name=name) def run(self): + print('Measure thread start') __listlock__.acquire() while not __terminate__ and len(__conflist__) > 0: img, config = __conflist__.pop() @@ -82,6 +85,7 @@ class measureThread(Thread): measure(img, config) __listlock__.acquire() __listlock__.release() + print('Measure thread stop') __preparethread__ = prepareThread() __measurethread__ = measureThread() |