You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I appreciate your library, also your previous response about the first sample code.
I have a problem with the second sample code, I appreciate it if you could help me with this issue.
When I run the multiprocessing code that you provided here, the following error happens:
##########################################################################
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable. File "C:\Users\royak\Programs\Python\Python36\lib\multiprocessing\spawn.py", line 105, in spawn_main
there are a bunch of lines but, the error description is as above.
Could you please guide me what should I do to fix this problem?
Many thanks in advance
The text was updated successfully, but these errors were encountered:
Hi there, sorry for the slow response getting back to you.
It sounds like you are trying to run this on windows is that correct? I had made the example quickly when using mac. Looking at this SO answer it seems like spawning child processes can cause recursive spawning if there isn't a __name__ == '__main__' guard in place.
Try changing bottom chunk of code to this:
if __name__ == '__main__':
os1 = OS1(OS1_IP, HOST_IP)
beam_intrinsics = json.loads(os1.get_beam_intrinsics())
beam_alt_angles = beam_intrinsics['beam_altitude_angles']
beam_az_angles = beam_intrinsics['beam_azimuth_angles']
workers = spawn_workers(4, worker, unprocessed_packets, beam_alt_angles, beam_az_angles)
os1.start()
try:
os1.run_forever(handler)
except KeyboardInterrupt:
for w in workers:
w.terminate()
I have another question, it is not related to your library but I appreciate it if you help me.
in the above code, when I try to capture the workers' outputs, each of them has its own output. How can I force them to work on the same input and the same output?
I tried to use the pool and manager, even thread, but I could not find a good way. Could you please help me with this issue?
Hello
I appreciate your library, also your previous response about the first sample code.
I have a problem with the second sample code, I appreciate it if you could help me with this issue.
When I run the multiprocessing code that you provided here, the following error happens:
##########################################################################
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
##########################################################################
there are a bunch of lines but, the error description is as above.
Could you please guide me what should I do to fix this problem?
Many thanks in advance
The text was updated successfully, but these errors were encountered: