ConcurrentQueue.wait_and_pop(detector); detector->detect(); ConcurrentQueue.push(detector);
detector->detect() is not thread safe.
Is the code safe in multithread env if ConcurrentQueue is implemented by mutex? Why?
Is the code safe in multithread env if ConcurrentQueue is implemented by lock free? Why?
0 comments:
Post a Comment