Giter Site home page Giter Site logo

Comments (5)

Lastique avatar Lastique commented on July 23, 2024

from log.

ctnewbold avatar ctnewbold commented on July 23, 2024

Admittedly this may be specific to our situation, but we do know that it's safe to unload the log library because we also know that there are no references to it from libraries that are not going to be unloaded. There may still be loggers in existence, but they're all from code that is also being unloaded.

I do agree with you in principle about having the application completely clean up. But in practice we've found it exceedingly difficult to get developers to use the logging library in a way that guarantees that loggers are not "leaked". For example, a logger might be declared as a non-static data member of a larger object that itself is "leaked".

Our guiding principle for logging has been Do No Harm. Developers should be able to (within reason) sprinkle logging in their code without an unnecessary level of concern that doing so may break their code. Unfortunately the consequences of leaking loggers ends up violating this principle for us. Developers add a logger and then the maintainers of our logging system get a bug report that logging is causing crashes...

I'm going to investigate a bit more to see if we can find some other local solution to this, but it would be nice for Boost.Log to be a bit more tolerant of "abuse" from application code.

from log.

Lastique avatar Lastique commented on July 23, 2024

from log.

ctnewbold avatar ctnewbold commented on July 23, 2024

Fair enough. We'll make local changes as necessary then in order to make Boost.Log robust for us. You still might want to take a look at the thread-local data management in core::implementation, though. The thread_specific_ptr is a non-static member, but then there is also the TLS-based member that is static--the discrepancy is odd. FWIW, we do build Boost.Log with compiler TLS support for the slight performance benefit. There's also a mutex used during initialization of thread-local values that's unnecessary.

from log.

Lastique avatar Lastique commented on July 23, 2024

The compiler-based TLS is a cache, which is a performance optimization compared to directly accessing thread_specific_ptr.

Note that making TLS static won't save you from leaking other resources allocated or held indirectly by the core. This includes memory, open files and Windows kernel objects.

from log.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.