File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -6,3 +6,5 @@ reinstall_eqsn.sh
6
6
dist /
7
7
EQSN.egg-info /
8
8
build
9
+ /.vs /EQSN_python /v16
10
+ /.vs
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ def __init__(self):
28
28
raise ValueError ("Use get instance to get this class" )
29
29
EQSN .__instance = self
30
30
self .manager = multiprocessing .Manager ()
31
- self .shared_dict = SharedDict .get_instance ()
32
31
cpu_count = multiprocessing .cpu_count ()
33
32
self .process_queue_list = []
34
33
for _ in range (cpu_count ):
@@ -39,6 +38,8 @@ def __init__(self):
39
38
self .process_queue_list .append ((p , q ))
40
39
self .process_picker = ProcessPicker .get_instance (
41
40
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 ()
42
43
43
44
def new_qubit (self , q_id ):
44
45
"""
Original file line number Diff line number Diff line change @@ -13,13 +13,14 @@ class WorkerProcess(object):
13
13
14
14
def __init__ (self , queue ):
15
15
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 ()
18
16
19
17
def run (self ):
20
18
"""
21
19
Run in loop and wait to receive tasks to perform.
22
20
"""
21
+ # Get a new instance, since their might be one from the old process
22
+ self .shared_dict = SharedDict .get_new_instance ()
23
+
23
24
amount_single_gate = 0
24
25
while True :
25
26
item = self .queue .get ()
You can’t perform that action at this time.
0 commit comments