Async might be a fad
11–20 of 76 posts
Re: Async might be a fad
#12I'm currently hacking on a toy webserver in Haskell, and from my point of view, I spin off a thread for each request, but Haskell's runtime environment manages all of these as a group of green threads doing aynch IO behind the scenes. Best of both worlds as far as I'm concerned. I just change serve request to forkIO (serve request) And magically I have multithreaded aynch IO that seems to be extremely performant.
Also, the discussion is in the context of imperative programming.
Re: Async might be a fad
#13Those are my thoughts; I'd like to hear counter arguments.
For example if I have a honey pot that collects random events, the clients can just send the data to it without expecting a result (IE: I don't care if it's successful or not) and honey pot is not expected to write any sort of response.
Clients send data and move on.
Re: Async might be a fad
#14It seems like such a waste to use async libraries in many Java applications and I wince at the thought of a mainstream application framework adopting CPS. In the techempower benchmarks Netty beats Servlet by only like 3%. Maybe if you are serving millions of connections you will get your money's worth but I think a synchronous API in the application stack is the right answer for almost everything. Even Play framework…
Re: Async might be a fad
#15I'm looking at the port of Quasar to Clojure as my sole reason for looking at Clojure over Erlang.
Re: Async might be a fad
#16Node has a very beginner-friendly primitive for doing this.
Re: Async might be a fad
#17I'm currently hacking on a toy webserver in Haskell, and from my point of view, I spin off a thread for each request, but Haskell's runtime environment manages all of these as a group of green threads doing aynch IO behind the scenes. Best of both worlds as far as I'm concerned. I just change serve request to forkIO (serve request) And magically I have multithreaded aynch IO that seems to be extremely performant.
Yes, if you have light-weight threads, there's no question that threaded programming is better than async programming. But we are talking about heavy Java thread, and whether its cost is so high that we need to avoid threaded programming. I think the answer is no, generally. Also, the discussion is in the context of imperative programming.
Re: Async might be a fad
#18The Greenhouse framework in Python is one of them (http://teepark.github.io/greenhouse/master/). The docs (linked) have a concise discussion of the various approaches to parallelizing IO operations with pros and cons of each, and, for most database applications, an obvious winner.
Re: Async might be a fad
#19I'm currently hacking on a toy webserver in Haskell, and from my point of view, I spin off a thread for each request, but Haskell's runtime environment manages all of these as a group of green threads doing aynch IO behind the scenes. Best of both worlds as far as I'm concerned. I just change serve request to forkIO (serve request) And magically I have multithreaded aynch IO that seems to be extremely performant.
Yes, if you have light-weight threads, there's no question that threaded programming is better than async programming. But we are talking about heavy Java thread, and whether its cost is so high that we need to avoid threaded programming. I think the answer is no, generally. Also, the discussion is in the context of imperative programming.
So I think that's the future we're looking at: most code async, with the likes of LAPACK and some ultra-low-latency I/O libraries (hedge funds and the like) being the only users of traditional heavy threads.
Re: Async might be a fad
#20Async computation is not the fad, it's poor syntax is. C#, F# and coffeescript have excellent syntax that remove the line noise caused by writing async code. Actors and channels also nicely remove line noise from async programming. If anything as computers become more powerful and distributed you'll see threads and locks disappear rather than async computation. Async computation in an imperative style is what most wa…
Of course, C# has great async support; but it is still a complicate thing that programmers must be very cautious about when applying.