Previous proposalBuilding microservices with firefly
Next proposalAutomating Web testing using Selenium,Tesseract and PIL
Concurrency vs Parallelism
Submitted by Narendran (@dudewhocode) on Wednesday, 13 September 2017
Technical level: Beginner Status: Submitted
Any task can be made embarrassingly parallel with your code by crunching up the resources and using all CPU cores. What if your system resources are limited, say single core?, How do we achieve the similar speed in execution of tasks?. In this talk we will discuss on how one can use python3 to achieve near speed as in parallelism but without compromising system resources. At the end of the talk the audience will know what are synchronous, asynchronous, parallelism and concurrent executions. They will be able to design and write concurrent programs with Python3’s asyncio package.
A good code is one which uses the system resources efficiently which means not over utilizing the resources as well as not under utilizing by leaving them idle. One of the main features of Python3 is its asynchronous capabilities. We will see how we can levarage the async library to concurrently run our code, efficiently use our resources and finish the tasks blazingly fast.
Concurrency is not parallelism
a. Synchronous vs Asynchronous execution
a. What is parallelism?
b. What is concurrency?
c. RealWorld example (how a restaurant operates concurrently, why not in parallel?)
Introduction to asyncio in python 3
d. Execution flow of concurrent program
e. Think like an asynchronous programmer
Deep dive into asyncio package
a. Context Switch
b. Blocking tasks
c. Order of Execution
d. Sync vs Async HTTP calls
e. Creating Concurrency
f. Return When
g. Cancel Future
h. Handling Exceptions
i. Retrieving Exceptions
j. Wait Timeout
k. Parallel HTTP call
l. Concurrent HTTP call
m. Concurrency vs Parallelism benchmark (by making 1000’s of requests to battlefield 4 server)
How concurrency is different from multi-threading?
When not to use concurrency?
Basic Python knowledge
Naren is a Product Engineer with specific focus on building robust backend and scalable systems. He works on open source projects in his spare time. He loves speaking at tech conferences and currently helping MadStreetDen in scaling their Artifical Intelligence products to millions. In his 4 years of industry experience he’s worn plenty of hats- like the one of a Trainer, Embedded Engineer and Backend/Product Engineer and sometimes even helmets- when he’s out cycling.
When he’s not stirring up code, you can find him whipping up a delicious gluten-free treat or travelling/cycling. He likes being asked about his endless love for Python through the handle @DudeWhoCode