Giter VIP home page Giter VIP logo

Comments (5)

cyrille-artho avatar cyrille-artho commented on August 30, 2024

What is the output that you get, and what output do you expect? If one thread is sometimes blocked, that's not a deadlock. It seems like there is always one thread that can continue, at least after an initial quick look at your code.

from jpf-core.

bupt01 avatar bupt01 commented on August 30, 2024

Is it true that only holding one lock and waiting for another lock to be released can be considered a deadlock? In this program, if the consumer executes first, it will block at line 12 (wait) in Semaphore.java. For the consumer to continue, the producer must execute line 9 (notifyAll()) in Semaphore.java. However, since the producer cannot execute the put() method, all threads will be in a blocked state. Can this situation be considered a deadlock? Can it be identified like the classic scenario of T1: lock(l1); lock(l2); and T2: lock(l2); lock(l1);?

from jpf-core.

cyrille-artho avatar cyrille-artho commented on August 30, 2024

JPF can find deadlocks in such situations, too. Can you please share your code in a way that it can be copied and ran locally? The most efficient way would be a small git repo with all the code and JPF configuration set up.

from jpf-core.

bupt01 avatar bupt01 commented on August 30, 2024

Thank you, I found a stupid error in one of my Settings

from jpf-core.

cyrille-artho avatar cyrille-artho commented on August 30, 2024

Thank you for confirming. We can close this issue then.

from jpf-core.

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.