The Naked Scientists
  • Login
  • Register
  • Podcasts
      • The Naked Scientists
      • eLife
      • Naked Genetics
      • Naked Astronomy
      • In short
      • Naked Neuroscience
      • Ask! The Naked Scientists
      • Question of the Week
      • Archive
      • Video
      • SUBSCRIBE to our Podcasts
  • Articles
      • Science News
      • Features
      • Interviews
      • Answers to Science Questions
  • Get Naked
      • Donate
      • Do an Experiment
      • Science Forum
      • Ask a Question
  • About
      • Meet the team
      • Our Sponsors
      • Site Map
      • Contact us

User menu

  • Login
  • Register
  • Home
  • Help
  • Search
  • Tags
  • Member Map
  • Recent Topics
  • Login
  • Register
  1. Naked Science Forum
  2. Non Life Sciences
  3. Geek Speak
  4. What is the purpose of asynchronous programming in Python?
« previous next »
  • Print
Pages: [1]   Go Down

What is the purpose of asynchronous programming in Python?

  • 2 Replies
  • 2115 Views
  • 2 Tags

0 Members and 1 Guest are viewing this topic.

Offline smart (OP)

  • Naked Science Forum King!
  • ******
  • 2454
  • Activity:
    0%
  • Thanked: 35 times
  • Breaking the box...
    • View Profile
    • https://www.thenakedscientists.com/forum/index.php?PHPSESSID=fbgpal9subfqub8c25ihcvg2g1&
What is the purpose of asynchronous programming in Python?
« on: 09/11/2017 11:50:39 »
Hi,

Since the HTTP 1.1 protocol is synchronous, and HTTP 2.0 is still in development, what is the purpose of asynchronous web programming in Python3 ? Are newer platforms like Android developed for asynchronous frameworks in mind ?

What do you think?
 
Logged
Not all who wander are lost...
 



Online evan_au

  • Global Moderator
  • Naked Science Forum GOD!
  • ********
  • 10341
  • Activity:
    36%
  • Thanked: 1245 times
    • View Profile
Re: What is the purpose of asynchronous programming in Python?
« Reply #1 on: 09/11/2017 20:23:29 »
Quote from: tkadm30
what is the purpose of asynchronous web programming in Python3 ?
Asynchronous programming means that your program can do multiple things at once, without the different "threads" interfering with each other too much.

So you can have one "thread" of execution prompting a user for input, while another thread downloads some data, and another thread listens for requests coming in from other users.

If done well, it can produce applications that handle far more users, and are more responsive.
If done poorly, it can result in obscure bugs that appear and disappear randomly, and are almost impossible to find.

Quote
the HTTP 1.1 protocol is synchronous, and HTTP 2.0 is still in development
The structure of your program is somewhat independent from the protocol you are using.

You can handle an asynchronous protocol with a single-threaded program, and vice-versa.
But it is simpler to write the software if you have a multi-threaded environment to handle multiple concurrent users and tasks.

Quote from: tkadm30
HTTP 2.0 is still in development
HTTP 2.0 was finalized in 2015, and many sites now support it.
See: https://en.wikipedia.org/wiki/HTTP/2
Logged
 

Offline smart (OP)

  • Naked Science Forum King!
  • ******
  • 2454
  • Activity:
    0%
  • Thanked: 35 times
  • Breaking the box...
    • View Profile
    • https://www.thenakedscientists.com/forum/index.php?PHPSESSID=fbgpal9subfqub8c25ihcvg2g1&
Re: What is the purpose of asynchronous programming in Python?
« Reply #2 on: 09/11/2017 20:56:47 »
Don't forget that the HTTP protocol is synchronous. So, I wander if the hype on asynchronous programming is to develop new frameworks for parallel computing (like machine learning) while moving away from the HTTP protocol designed for humans in mind.



 
Logged
Not all who wander are lost...
 



  • Print
Pages: [1]   Go Up
« previous next »
Tags: python  / asyncio 
 

Similar topics (5)

What is the blockchain and what purpose does blockchain serve?

Started by scientizschtBoard General Science

Replies: 2
Views: 1828
Last post 30/07/2018 10:57:58
by Ophiolite
Here is Practical Explanation about Next Life, Purpose of Human Life,

Started by bhaahBoard General Science

Replies: 0
Views: 2019
Last post 07/12/2018 18:03:15
by bhaah
Here is Practical Explanation about Next Life, Purpose of Human Life,

Started by lodhaGBoard That CAN'T be true!

Replies: 4
Views: 1960
Last post 01/04/2019 22:21:22
by Colin2B
What purpose do thorns serve on berry bushes and roses other then protection?

Started by Karen W.Board Plant Sciences, Zoology & Evolution

Replies: 35
Views: 33186
Last post 09/04/2009 13:08:52
by dentstudent
Do colours, flavours, and aromas serve any nutritional purpose?

Started by Atomic-SBoard Plant Sciences, Zoology & Evolution

Replies: 9
Views: 5380
Last post 30/05/2019 19:04:23
by Bored chemist
There was an error while thanking
Thanking...
  • SMF 2.0.15 | SMF © 2017, Simple Machines
    Privacy Policy
    SMFAds for Free Forums
  • Naked Science Forum ©

Page created in 0.112 seconds with 35 queries.

  • Podcasts
  • Articles
  • Get Naked
  • About
  • Contact us
  • Advertise
  • Privacy Policy
  • Subscribe to newsletter
  • We love feedback

Follow us

cambridge_logo_footer.png

©The Naked Scientists® 2000–2017 | The Naked Scientists® and Naked Science® are registered trademarks created by Dr Chris Smith. Information presented on this website is the opinion of the individual contributors and does not reflect the general views of the administrators, editors, moderators, sponsors, Cambridge University or the public at large.