3 ms·
> >Performance. Is identical. In a very high concurrency environment with OS based threads it is not always the case. OS threads start to show their overhead (
by rdtsc 14y ago
> >Performance.
Is identical.
In a very high concurrency environment with OS based threads it is not always the case. OS threads start to show their overhead ( both in switching and memory consumption ) when we get to 10K+ # of requests (I am assuming some server-client architecture here).
Async or green threads have a smaller overhead of switching, but any CPU based concurrency is usually missing (save for Erlang,Go,Haskell & Rust?). So for small IO bound programs it becomes hard to beat an epoll based loop (as nginx and haproxy show). As soon as any dispatches start computing things then the whole OS process blocks and sockets start throwing errors and everything goes to shit.
- papsosouid 14y ago>In a very high concurrency environment with OS based threads it is not always the case. We're talking about green threads, remember? >Async or green threads have a smaller overhead of switching, but any CPU based concurrency is usually missing The point is that async and green threads are the same thing, just one has a better interface. Of course they both have the same downside.
- rdtsc 14y ago> We're talking about green threads, remember? Sorry lost context. Yes, for green threads you are right. I had regular (OS) threads in mind.