Skip to content

Commit edaab20

Browse files
authored
Merge pull request #12 from tqsd/windows_changes
Windows changes
2 parents f18a321 + e643c2c commit edaab20

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ reinstall_eqsn.sh
66
dist/
77
EQSN.egg-info/
88
build
9+
/.vs/EQSN_python/v16
10+
/.vs

eqsn/gates.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def __init__(self):
2828
raise ValueError("Use get instance to get this class")
2929
EQSN.__instance = self
3030
self.manager = multiprocessing.Manager()
31-
self.shared_dict = SharedDict.get_instance()
3231
cpu_count = multiprocessing.cpu_count()
3332
self.process_queue_list = []
3433
for _ in range(cpu_count):
@@ -39,6 +38,8 @@ def __init__(self):
3938
self.process_queue_list.append((p, q))
4039
self.process_picker = ProcessPicker.get_instance(
4140
cpu_count, self.process_queue_list)
41+
# create the shared dict after all the processes have been created.
42+
self.shared_dict = SharedDict.get_instance()
4243

4344
def new_qubit(self, q_id):
4445
"""

eqsn/worker_process.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ class WorkerProcess(object):
1313

1414
def __init__(self, queue):
1515
self.queue = queue
16-
# Get a new instance, since their might be one from the old process
17-
self.shared_dict = SharedDict.get_new_instance()
1816

1917
def run(self):
2018
"""
2119
Run in loop and wait to receive tasks to perform.
2220
"""
21+
# Get a new instance, since their might be one from the old process
22+
self.shared_dict = SharedDict.get_new_instance()
23+
2324
amount_single_gate = 0
2425
while True:
2526
item = self.queue.get()

0 commit comments

Comments
 (0)