Git Product home page Git Product logo

Comments (8)

wilx avatar wilx commented on May 28, 2024 1

Ooops, somehow, I mentally switched from iOS that you are concerned about to Android. :)

from log4cplus.

wilx avatar wilx commented on May 28, 2024

IIRC there were some linking issues with the threaded version observed by somebody in the bast. I have no way of testing this so I rely on reports. There is no reason in log4cplus itself why it should not support threading on iOS as far as I know. Feel free to experiment and try different setting. Please report back if you make it work with threading.

from log4cplus.

dmigous avatar dmigous commented on May 28, 2024

Multi-threaded works perfectly on the device. But somehow only arm64 version depends on __tlv_bootstrap that is private API for Apple...

If I will turn single-threaded mode, then what features will be turned off? NDC?

from log4cplus.

wilx avatar wilx commented on May 28, 2024

There is a section in README.md about iOS support. At its very end there is note that suggests to comment out these lines from ConfigureChecks.cmake:

set(LOG4CPLUS_HAVE_TLS_SUPPORT 1)
set(LOG4CPLUS_THREAD_LOCAL_VAR "__thread")

This will disable use of TLS based on __thread keyword in log4cplus and it should fall back to POSIX' pthread_setspecific(). This, I think, should solve your problem.

To answer your question, NDC should work in single threaded build as well. In that case the "TLS" data are just a global variable then.

from log4cplus.

dmigous avatar dmigous commented on May 28, 2024

So...
Thanks for you hint regarding how to turn off TLS. I'm using Autotools build system version. So I came to commenting line in configure.ac:

#AX_TLS_SUPPORT

Apple review passed.

Now I think we need to make TLS switchable with some flag to cmake and to ./configure. What do you think?

from log4cplus.

wilx avatar wilx commented on May 28, 2024

Now I think we need to make TLS switchable with some flag to cmake and to ./configure. What do you think?

Using switches is suboptimal, IMHO.

I instead of switches, I would rather enhance the AX_TLS_SUPPORT macro to automatically disable TLS support for either iOS or Android or both, if it is simply never going to work. But if there is a reliable way how to detect that it will work, I would rather enhance it in this respect.

...

Well, I did some searching and it seems Android simply does not support __thread, so it should be disabled in the CMake configuration for Android by default.

I have actually never heard of anyone using log4cplus on Android through the Autotools build system, so fixing that might be less important.

So, if you feel like it, please submit patches that change the defaults for Android. If you know and can test and patch iOS support then do not hesitate to change it as well.

from log4cplus.

wilx avatar wilx commented on May 28, 2024

I see https://llvm.org/bugs/show_bug.cgi?id=19232, it suggests iOS simply does not support TLS and only POSIX API is supported.

from log4cplus.

dmigous avatar dmigous commented on May 28, 2024

I think it may be closed after pull request merged

from log4cplus.

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.