logoalt Hacker News

inkyoto • today at 1:03 PM • 1 reply • view on HN

«Threads» imply «shared state» within the confines of the same process, hence the need for locking primitives, mutexes, and alike.

«Actors» imply «no shared state» – there is a message inbox and a message outbox, but the state is private to the actor.

Both can be asynchronous.


Replies

zbentley • today at 1:10 PM

I think this taxonomy is not good. It’s comparing apples to oranges, or apples to fruit sugars or something.

Threads are not a programming paradigm or style, any more than a CPU is a programming paradigm or style. They’re a tool, an existential piece of the landscape which can be used to perform paradigms/styles. Like CPUs, they do have affinity for certain use cases, but the car is not the road trip.

➕ show 2 replies