diff --git a/Multiprocessing test/calc_pi_linux.py b/Multiprocessing test/calc_pi_linux.py index b6ef69d..f27b52a 100644 --- a/Multiprocessing test/calc_pi_linux.py +++ b/Multiprocessing test/calc_pi_linux.py @@ -21,7 +21,9 @@ from multiprocessing import Queue, Process import queue from decimal import Decimal, getcontext -DELAY1 = 80 +import time + +DELAY1 = 20 DELAY2 = 20 class Example(Frame): @@ -116,7 +118,8 @@ class Example(Frame): print (self.p1.is_alive()) queue.put(pi) - print("end") + print("end") + time.sleep(1) def main(): diff --git a/h2inc.py b/h2inc.py index 1ac0511..c121503 100755 --- a/h2inc.py +++ b/h2inc.py @@ -53,13 +53,13 @@ def sourcedir_foldercnt(sourcedir): #print(len(folderlist)) return cnt -def process_files(source, dest): +def process_files(gui, source, dest): global sourcedir global destdir sourcedir = source destdir = dest pool = mp.Pool(processes=num_cores) - pool.map(process_file, filelist) + pool.map(process_file, filelist, gui) def process_file(data): outfile = '' @@ -106,7 +106,7 @@ def process_file(data): newfile = open(outputfile, "w") newfile.write(outfile) newfile.close() - + def async_process(num): pool = mp.Pool(processes=num) pool.map(process_file, filelist) \ No newline at end of file