I'm started a concurrent program using Python. I have a simple question: I'm using the class Thread to create several concurrent processes. I would like these threads to pass objects to each other (so I would like that a thread not only notice a certain event, but takes an object from this event (when it happens)!). How can I do this? Thanks a lot!
Example of code:
class Process(Thread):
def __init__(self):
super(Processo, self).__init__()
def run(self):
myObject = SomeObject(param1, param2, param3)
# Code to pass myObject to all the threads
# Code waiting for the object to use it
def main():
process1 = Process()
process2 = Process()
process3 = Process()
process1.start()
process2.start()
process3.start()