Home > Back-end >  Consult, simple multithreaded synchronization problem
Consult, simple multithreaded synchronization problem

Time:01-09

Assumptions, three elements in a queue, I use three threads corresponding to the three elements, this time will produce a deadlock, need not lock, because these three elements are in a queue

CodePudding user response:

Don't need to lock
No locking nature also no deadlock
But pay attention to add/remove queue elements such as operation need to lock

CodePudding user response:

There is also change,,,