Re:Multithreading Magic - Why Everything You Thought You Kne...
by toddh on Sunday February 06, 2011 @12:02PM
(#2185935)
I've built quite a few actor systems in C++ for real-time platforms. You use a threading library like pthreads, which works fine in C++, use thread safe libraries, create an Actor object with a queue that encapsulates a thread, and then have your async messaging system route and drop messages in the right actor queue. As long as application writers can manage their impulses to share state between the threads it works excellently. The only problem is usually the shared state inherent in the memory allocator, so some sort of thread based memory allocation scheme works best. You also get to choose your response latency via priority, which is something you don't get with Erlang.
[ Parent
| on HN ]
Re:Multithreading Magic - Why Everything You Thought You Kne...
by defen on Sunday February 06, 2011 @12:52PM
(#2186032)
Keep in mind that the original point of erlang was "reliable software", not "high performance" (quotes because those are fuzzy terms) - there are many classes of errors that simply cannot happen in erlang that happen all the time in real-world C++ programming. You also get distributed computation for free via a well-tested VM.