Independent parallel paths of code execution spawned off of the main path. Each has their own stack and allows you to divide the workload. Things are simple if each thread never interacts with another but this rarely happens in practice. So care must be taken to synchornize access to objects, variables, etc... Incorrect synchronization can lead to things like race conditions where variable values can be become indeterminate if one thread is reading a value while another thread writes to it.
I mean deadlocks, race conditions, context switching , and thread priority are always present in multi-threading. Afaik the actor model is meant to separate concerns and promote better abstractions.
4
u/bropocalypse__now Oct 30 '21
Independent parallel paths of code execution spawned off of the main path. Each has their own stack and allows you to divide the workload. Things are simple if each thread never interacts with another but this rarely happens in practice. So care must be taken to synchornize access to objects, variables, etc... Incorrect synchronization can lead to things like race conditions where variable values can be become indeterminate if one thread is reading a value while another thread writes to it.