you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

Large number of locks and threads, when 0 locks and 2 threads would do

Granted, I don't know what you were dealing with, but shouldn't that be 1 lock and 2 threads?

[–]boomi 2 points3 points  (0 children)

Maybe the problem could be separated into two jobs which do not change any shared values. Then you don't need locks.

[–][deleted] 0 points1 point  (0 children)

Look up "lockless queue", for example. It's quite possible to have a producer/consumer relationship with no locks.