osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Benefits of asyncio


Marko Rauhamaa <marko at pacujo.net> writes:
> That's a good reason to avoid threads. Once you realize you would have
> been better off with an async approach, you'll have to start over.

That just hasn't happened to me yet, at least in terms of program
organization.  Python threads get too slow once there are too many
tasks, but that's just an implementation artifact of Python threads, and
goes along with Python being slow in general.  Write threaded code in
GHC or Erlang or maybe Go, and you can handle millions of connections,
as the threads are in userspace and are very lightweight and fast.

http://haskell.cs.yale.edu/wp-content/uploads/2013/08/hask035-voellmy.pdf