python - why multiprocessing function Process doesn't work -


i want use module multiprocessing execute 2 functions @ same time doesn't work. code in these 2 functions depends on library of these 2 instruments, there has no matter multiprocessing

import multiprocessing mp  def mesure_rfb():   libc.startmeas()   time.sleep(0.5)   while libc.measuring() == -1:       time.sleep(1)  def mesure_nrt():   global ave,rev,chrono   my_nrt.zeroing()   my_nrt.setimeout(100000)   tstart = time.time()   b=2   ave,rev,chrono = my_nrt.measurement(times=b)   a=time.time()-tstart   print('measurement cost: ' , a,' s')   print('a measurement costs: ' , a/b,' s')  if __name__ == '__main__':   rfb = mp.process(name='rfb measuring', target=mesure_rfb)   nrt = mp.process(name='nrt measuring', target=mesure_nrt)   rfb.start()   nrt.start()   rfb.join()   nrt.join() 

as run part of programme, executes function mesure_nrt. quite new python. appreciated.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -