GithubHelp home page GithubHelp logo

Concurrency warning about dycon HOT 2 OPEN

dmlloyd avatar dmlloyd commented on June 17, 2024
Concurrency warning

from dycon.

Comments (2)

nnym avatar nnym commented on June 17, 2024

Thanks for the tip. I had the false impression that the JVM prevented concurrent dynamic constant bootstrap and didn't think to check. I probably should remove the examples too then.

If you put those two things together, it adds up to potential deadlock if user locking is used and there is a cycle in constant initialization.

The quotation above seems to preclude deadlocks and I don't understand how they fit together to produce it. In any case, cycles in initialization seem like the responsibility of the programmer (just like endless cycles in function calls) to me.

from dycon.

dmlloyd avatar dmlloyd commented on June 17, 2024

Thanks for the tip. I had the false impression that the JVM prevented concurrent dynamic constant bootstrap and didn't think to check. I probably should remove the examples too then.

It's unfortunate to be sure. With the recent talk of lazy statics, I wonder if they don't regret this decision now.

If you put those two things together, it adds up to potential deadlock if user locking is used and there is a cycle in constant initialization.

The quotation above seems to preclude deadlocks and I don't understand how they fit together to produce it.

They only do when combined with the latter part of the sentence "... if user locking is used". Sorry if my wording is not clear.

In any case, cycles in initialization seem like the responsibility of the programmer (just like endless cycles in function calls) to me.

Yes, this is a valid perspective. The user does have to be careful when using locks in combination with indeterminate initialization order; the JVM will do nothing to help you diagnose the issue if you do inadvertently cause a deadlock (which is unfortunate IMO).

from dycon.

Related Issues (2)

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.