it is said in scala that using the actors can scale much better compared with traditional threading. I can understand that bit like keep thread blocking is obviously not good. but what is the difference of thread scheduling new tasks and thread context switches? isn't this kind of scheduling new tasks will incur performance penalties as well ?
similar scenario in .NET as well, the async does similar things, I don't understand the difference here of the thread switching off from the state machine switching on to the unfinished tasks with context switches happen on threads, after all what's the difference?
Firstly I don't think the my question is duplication of the reffered link. Secondly I don't think the referred question is properly answered. but they provide some related infomation that shed lights on my question.
Important Actors that Unify Threads and Events - Philipp Haller, Martin Odersky
Actors are not that light weight at all, which can be concluded from the benchmarks in the reference paper. for thread based actors , actor per thread, so essentially the same for event based actors , when actors react, the state of it will be persisted out to thread queue, a new actor state will switched in, so in a sense there are data switches happening within the worker thread, but there are no kernel calls happened which I think is the most proeminent difference compared with actor data switches
the important thing is actor is preferrable in terms of its scalability, we can see from the referenced paper, when process is not that much, the throughouput is even less than traditional java concurrency.