by Narendran (@dudewhocode) on Wednesday, 13 September 2017

+2
Vote on this proposal
Status: Submitted
Technical level
Beginner

Media

Abstract

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

An optimist by nature, Naren shows up late to meetings at MadStreetDen. 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. He is currently on a mission to help startups to design and write usable software even before making it reusable.
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

Comments

  • 2
    [-] Kushal Das (@kushaldas) Reviewer a month ago

    Thank you for submitting the talk to PyCon Pune. The talk selection team will contact you here in case of any queries. Meanwhile, please make sure that you provide a link to the presentation slides.

    • 1
      [-] Narendran (@dudewhocode) Proposer a month ago (edited 29 days ago)

      I have already added some slides which is just an outline. Now working on more comprehensive one with lots of asyncio concepts and code examples, will update it in few days.

    • 1
      [-] Narendran (@dudewhocode) Proposer 29 days ago

      Hi @kushaldas, I have added my full slides for the talk and updated the abstract and outline too.
      Thanks

Login with Twitter or Google to leave a comment