New answers tagged

4 votes

Logging in a different thread using circular buffer C++

Create a separate class for the message queue Your class my_logger has too many responsibilities and is therefore quite complex. ...
G. Sliepen's user avatar
  • 54.2k
2 votes

Implementation of Concurrent List in .NET

There appear to be several threading bugs in this implementation. Just the first line with any logic in it, what if two threads call Insert with ...
Pierre Menard's user avatar
3 votes

Design a thread-safe Hit Counter

For this design, making it threadsafe is just about using a lock statement to allow just one thread to modify the data structure at a time. This implementation is fine and appears to be correct. ...
Pierre Menard's user avatar
5 votes

Lazily decode a buffer with a thread-safe Iterator

In its current form, the code doesn't work: unless it's an inner class of some enclosing one, the constructor should not be private; Utils.getInt(...) needs a ...
morgwai's user avatar
  • 391

Top 50 recent answers are included