From 4351221d7ee235a27016210360af23bcaff11c97 Mon Sep 17 00:00:00 2001 From: Lerking <33354709+Lerking@users.noreply.github.com> Date: Tue, 8 May 2018 13:03:00 +0200 Subject: [PATCH] Delete h2inc_mp.py --- h2inc_mp.py | 55 ----------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 h2inc_mp.py diff --git a/h2inc_mp.py b/h2inc_mp.py deleted file mode 100644 index d1bf736..0000000 --- a/h2inc_mp.py +++ /dev/null @@ -1,55 +0,0 @@ -# You are free to use and/or change this code for -# your own needs. - -# Original code (c)2018 Jan Lerking -# Program to convert C-header (*.h) files to nasm include files (*.inc), -# for direct usage in assembly programming using nasm/yasm. - -import multiprocessing -from queue import Queue -from threading import Thread -import threading -from h2inc_globals import filelist, cnt -from h2inc_fp import process_file - -num_cores = multiprocessing.cpu_count() - -class Worker(Thread): - def __init__(self, queue): - Thread.__init__(self) - self.queue = queue - - def go(self): - print("The worker has started doing some work (counting from 0 to 9)") - #for i in range(self.filecnt): - #proportion = (float(i+1))/self.filecnt - #self.queue.put((proportion, "working...", i)) - #time.sleep(0.01) - #process_file(filelist[i]) - #self.queue.put((1.0, "finished")) - #print("The worker has finished.") - while True: - cfile = self.queue.get() - process_file(cfile) - self.queue.task_done() - -def start_workers(): - print("Creating shared Queue") - queue = Queue() - - print("Number of cores:", num_cores) - - for n in range(num_cores): - print("Creating Worker", n) - - worker = Worker(queue) - worker.deamon = True - worker.start() - - for cfile in filelist: - print("Queueing {}".format(cfile)) - queue.put(cfile) - - queue.join() - return -