Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import modem1 # custom process (multiprocessing) for modem1
- import modem2 # custom process (multiprocessing) for modem2
- import populator # custom process (multiprocessing) to populate the Queue
- import multiprocessing
- if __name__== '__main__':
- # define the queues
- Q = multiprocessing.Queue()
- p = populator.Populate(Q) # this is another process to fetch and put tasks in Q
- p.deamon = True
- p.start()
- # initialize the modems
- p1 = modem1.Modem1('/dev/ttyUSB0',Q)
- p1.deamon = True
- p1.start()
- p2 = modem2.Modem2('/dev/ttyUSB1',Q)
- p2.deamon = True
- p2.start()
- p.join()
- p1.join()
- p2.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement