Code Monkey home page Code Monkey logo

Comments (7)

CarterLi avatar CarterLi commented on September 21, 2024

Ref: fastfetch-cli/fastfetch#499

If I remove the dlclose it won't crash

from ddcutil.

rockowitz avatar rockowitz commented on September 21, 2024

Thank you for the report. There had been vague assertions in the past about dlopen()/dlclose() not working. Your detailed report makes the locus of the problem obvious.

I have pushed the needed changes to branch 2.0.0-dev. For now trace messages are emitted unconditionally - that of course will change. More significantly, the termination function in the mainline sleeps for 4 seconds to allow for the sleep in the polling loop to complete, after which the polling loop checks if the terminate flag is set. Is this a problem for you? If so, the sleep duration in the polling loop could be decreased, increasing the frequency with with the loop checks for rare display hotplug events.

from ddcutil.

CarterLi avatar CarterLi commented on September 21, 2024

More significantly, the termination function in the mainline sleeps for 4 seconds to allow for the sleep in the polling loop to complete, after which the polling loop checks if the terminate flag is set. Is this a problem for you?

It's a serious problem for me. My program is performance sensitive and I don't want any delays. I'd rather not dlclose it and leak the memories.

I don't need watch. My program should end in seconds. Can we have a flag / option to disable the watch thread?

from ddcutil.

rockowitz avatar rockowitz commented on September 21, 2024

Yes. Function ddca_init(), new in release 2.0.0, could be made to control whether watching for display hotplug events occurs, either through a flag on argument opts, or using the option string argument libopts. I need to think through which is better and what the defaults should be.

from ddcutil.

rockowitz avatar rockowitz commented on September 21, 2024

Function ddca_init() now recognizes strings "--enable-watch-displays" and "--disable-watch-displays" in its libopts string argument. Haven't decided yet what the default should be, but in any event if you specify "--disable-watch-displays" explicitly that will override the default. I have pushed the changes to branch 2.0.0-dev.

from ddcutil.

rockowitz avatar rockowitz commented on September 21, 2024

Why did you choose to use dlopen()/dlclose() instead of just linking to the shared library? Is it so that your program will execute even if the required version of libddcutil is not present, or is there some other reason?

from ddcutil.

CarterLi avatar CarterLi commented on September 21, 2024

Is it so that your program will execute even if the required version of libddcutil is not present?

even if libddcutil is not present

from ddcutil.

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.