Multi-threading/Multi-Processing in Python using ZeroMQ.
Akash Mishra (~akash2) |
This talk will be about writing concurrent python code using ZMQ and its python bindings.
There are two schools of thought with regard to concurrency. One believes in shared memory and embraces all the complexities that come bundled with it like mutexes, locks. The other believes in message passing meaning that threads/processes interact explicitly by sending messages and do not share state.
The speaker firmly believes in the message passing school because of its simplicity over shared memory and intends to convert every person in the room through this talk.
ZeroMQ allows you to write concise and easy to understand multi threaded code that simulates the message passing model. Your threads dont share state, they communicate only by passing messages. This allows you to later split your threads into separate processes as your application needs evolve.
What will be covered:
- Concurrency (what, why)
- Why message passing over shared memory
- ZeroMQ sockets
- Reliable communication patterns using ZMQ
- Multithreaded code using ZMQ
- Advantages over traditional threading model.
- Conversion to multiprocess
- Performance comparison with the batteries included (multiprocessing)
The above may change as the speaker prepares the talk
What will not be covered:
- Critical sections
- Multithreading vs Multiprocessing
Akash Mishra (@akash47) is working as a software developer at Betaout. He stumbled onto ZeroMQ while wandering in the python land for better concurrency options. ZeroMQ allowed him to keep his hair while writing concurrent code in python and hence he wants to tell everyone about how awesome it is.