PyCon, the gathering for the community using and developing the open-source Python programming language. This is the second year of the PyCon Pune where the community will meet for two days of talks and working on upstream projects in two days of dev sprint. CFP ends on 15th September AoE.

Website: https://pune.pycon.org/2018/

Note to submitters: The talks will be selected by a team. We will not count the public votes.

Hosted by

PyCon Pune 2017 more

Naren

@dudewhocode

Concurrency vs Parallelism

Submitted Sep 13, 2017

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.

Outline

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
a. Eventloops
b. Co-routines
c. Futures
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?

Summary

Requirements

Basic Python knowledge

Speaker bio

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

Slides

http://dudewho.codes/blog/assets/slides/concurrency_vs_parallelism_45min.pdf

Comments

{{ gettext('Login to leave a comment') }}

{{ gettext('Post a comment…') }}
{{ gettext('New comment') }}
{{ formTitle }}

{{ errorMsg }}

{{ gettext('No comments posted yet') }}

Hosted by

PyCon Pune 2017 more