Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshen Lim authored and Joshen Lim committed Nov 8, 2019
1 parent aa44861 commit 3ef978a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 2 additions & 5 deletions src/communicator/MultiProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
log = Logger()

'''
Multithreading essentially refers to running multiple processes in parallel
Communications between Rpi and other devices involve a session, which means
the Rpi will be waiting for a trigger. Hence if single threaded, Rpi can only
do one thing at one time. With multhreading, Rpi can have multiple sessions
simultaneuously. Image Recognition will have to be run as a thread as well.
Multiprocess to use all available cores on the Rpi
Higher efficiency than multithreading
'''

class MultiProcess:
Expand Down
8 changes: 5 additions & 3 deletions src/communicator/MultiProcess_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@

log = Logger()

'''
New structure for multiprocessing to have only 2 queues
Image Recognition process to run in main program
'''

class MultiProcess:
def __init__(self, verbose):
log.info('Initializing Multiprocessing Communication')
Expand All @@ -21,9 +26,6 @@ def __init__(self, verbose):
self.pc = PC()
self.detector = SymbolDetector()

# Just see if this makes the latency worse
# Otherwise try see if can do a mutex
# Essentially a separate process must be able to trigger the parent program
self.msg_queue = Queue()
self.img_queue = Queue()

Expand Down

0 comments on commit 3ef978a

Please sign in to comment.