Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. import modem1 # custom process (multiprocessing) for modem1
  2. import modem2 # custom process (multiprocessing) for modem2
  3. import populator # custom process (multiprocessing) to populate the Queue
  4. import multiprocessing
  5.  
  6.  
  7. if __name__== '__main__':
  8.  
  9. # define the queues
  10.  
  11. Q = multiprocessing.Queue()
  12.  
  13. p = populator.Populate(Q) # this is another process to fetch and put tasks in Q
  14. p.deamon = True
  15. p.start()
  16.  
  17. # initialize the modems
  18. p1 = modem1.Modem1('/dev/ttyUSB0',Q)
  19. p1.deamon = True
  20. p1.start()
  21.  
  22. p2 = modem2.Modem2('/dev/ttyUSB1',Q)
  23. p2.deamon = True
  24. p2.start()
  25.  
  26. p.join()
  27. p1.join()
  28. p2.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement