Thread liveness
Deadlock
t1 = Thread(some_unit) // thread is not started
t1.start() // thread is executing
// e.g. we are in thread t0
t1.join() // it means thread t0 waits for thread t1 to complete
A deadlock occurs when two threads wait for each other indefinitely, so that neither can make any progress.
Livelock

Livelock is a situation when there is a condition both both thread to finish the work, by as far as threads affect condition of each other they can not finish.
A great example of livelock is a messaging system where, when an exception occurs, the message consumer rolls back the transaction and puts the message back to the head of the queue. Then the same message is repeatedly read from the queue, only to cause another exception and be put back on the queue. The consumer will never pick up any other message from the queue.
Thread starvation

Last updated
Was this helpful?