Skip to main content
added 276 characters in body
Source Link
ratchet freak
  • 26k
  • 2
  • 64
  • 100

thean acceptable way it to use the singleton logger which delegates the actual logging to it'sits own thread

you can then use any efficient producer-consumerproducer-consumer solution (like a non-blocking linked list based on the atomic CaS) to gather the log messages without worrying that it is an implicit global lock

the log call will then first filter and build the log message and then pass it to the consumer, the consumer will then grab it and write it out (and free the resources of the individual message)

the acceptable way it to use the singleton logger which delegates the logging to it's own thread

you can then use any efficient producer-consumer solution (like a non-blocking linked list based on the atomic CaS) to gather the log messages without worrying that it is an implicit global lock

an acceptable way it to use the singleton logger which delegates the actual logging to its own thread

you can then use any efficient producer-consumer solution (like a non-blocking linked list based on the atomic CaS) to gather the log messages without worrying that it is an implicit global lock

the log call will then first filter and build the log message and then pass it to the consumer, the consumer will then grab it and write it out (and free the resources of the individual message)

Source Link
ratchet freak
  • 26k
  • 2
  • 64
  • 100

the acceptable way it to use the singleton logger which delegates the logging to it's own thread

you can then use any efficient producer-consumer solution (like a non-blocking linked list based on the atomic CaS) to gather the log messages without worrying that it is an implicit global lock