Journey to a threadsafe GLog module

I’m still in the progress of trying to make GLog module threadsafe. Right now, log output to screen still having multithreading issue, which must be solve no matter how. Below is what has been happening up to this point:

  1. Knowing that std::cout is not threadsafe, have been looking for alternative, without applying lock on every single call to add/append log message.
  2. Looked into dedicated logging thread, but stuck after my design was found not solving the problem. Or… perhaps I’m simply lacking of sound understanding on terminal stuff.
  3. The ‘Internet’ suggested me a shortcut – Boost.Asio.
  4. Unable to understand the basic concept of Asio. Reactor?? Proactor?? I heard about these patterns before but never know how do they work.
  5. Found a good explanation on Proactor pattern v.s. Reactor pattern v.s. Multi-threaded Synchronous. Still reading…

Shall this problem can’t be solve in next one or two weeks, probably I will go back to the old plan — pick an existing ‘feature-rich’ logging framework.

1 Comment to “Journey to a threadsafe GLog module”