jcstress | https | Testing library

 by   openjdk Java Version: 0.16 License: GPL-2.0

kandi X-RAY | jcstress Summary

kandi X-RAY | jcstress Summary

jcstress is a Java library typically used in Testing applications. jcstress has no bugs, it has no vulnerabilities, it has build file available, it has a Strong Copyleft License and it has low support. You can download it from GitHub, Maven.

The Java Concurrency Stress (jcstress) is the experimental harness and a suite of tests to aid the research in the correctness of concurrency support in the JVM, class libraries, and hardware.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              jcstress has a low active ecosystem.
              It has 313 star(s) with 50 fork(s). There are 12 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              jcstress has no issues reported. There are 5 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of jcstress is 0.16

            kandi-Quality Quality

              jcstress has no bugs reported.

            kandi-Security Security

              jcstress has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              jcstress is licensed under the GPL-2.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              jcstress releases are not available. You will need to build from source code and install.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed jcstress and discovered the below as its top functions. This is intended to give you an instant insight into jcstress implemented functionality, and help decide if they suit your requirements.
            • Main entry point
            • Run the test
            • Rehashes the map
            • Copies the given result
            • Emit test report for given test
            • Selects the color of the given type
            • Print the header of the test result
            • Formats the command line options
            • Returns a line for the given option descriptor
            • Drains the stream
            • Prints out allocation profile
            • Returns all keys in the specified multiset
            • Get the Unsafe Unsafe
            • Copy a file to a temporary file
            • Main method for testing
            • Two actors
            • Gets the global affinity map
            • Post update
            • Awaits until the checkpoint is reached
            • Convert an object to string representation
            • Generate a string representation of the result
            • Acquires the specified instance
            • Command line parser
            • Renumber all packages
            • Tries to initialize allocation
            • Renumber cores
            Get all kandi verified functions for this library.

            jcstress Key Features

            No Key Features are available at this moment for jcstress.

            jcstress Examples and Code Snippets

            No Code Snippets are available at this moment for jcstress.

            Community Discussions

            QUESTION

            -XX:+StressLCM, -XX:+StressGCM Options for JVM
            Asked 2019-May-23 at 16:05

            While playing with some jcstress code, I noticed two parameters that are very new to me: StressLCM and StressGCM.

            The very first thing to do for me was searching for these in the source code itself and while I have found some things, it is still unclear what they actually do. I was really hoping to see some comments in the source code that would shed some light, but no luck.

            I also found the bug description where these have been added, but the explanation made no sense for me:

            Randomize instruction scheduling in LCM/GCM.

            Can someone explain what they do, if possible in plain english?

            ...

            ANSWER

            Answered 2019-May-23 at 16:05

            LCM / GCM stands for Local Code Motion / Global Code Motion. To optimize CPU utilization, compiler may reorder independent instructions without changing the semantics of the code. Compiler tries to find the most optimal (from performance perspective) order of instructions. This is called instruction scheduling, and that's what LCM / GCM do.

            With -XX:+StressLCM / -XX:+StressGCM options the instruction scheduling works in a bit different way. It no longer tries to find the best schedule, but instead chooses a random instruction order within the allowed constraints, still keeping the original semantics unchanged. Such nondeterministic behavior helps to test more combinations of instruction interleaving, which is essential in finding subtle concurrency issues.

            Source https://stackoverflow.com/questions/56273136

            QUESTION

            Running first JCStress test
            Asked 2018-Nov-24 at 14:10

            I'm new to JCStress and I'm trying to run the "hello world" for JCStress but facing some problems. I think there is some obvious thing that I'm missing.

            I'm following this link to learn. And the samples that I'm trying are here.

            I started with the template project created from the following public maven archetype:

            ...

            ANSWER

            Answered 2018-Nov-24 at 14:10

            Ah, I figured out what I was missing.

            We need to do a mvn clean install to get MyConcurrencyTest into the META-INF/TestList file.

            Now I can run

            Source https://stackoverflow.com/questions/53458367

            QUESTION

            Confused by jcstress test on ReentrantReadWriteLock#tryLock failing
            Asked 2018-Oct-07 at 06:03

            I am trying to get to grips with JCStress. To ensure I understand it, I decided to write some simple tests for something that I know must be correct: java.util.concurrent.locks.ReentrantReadWriteLock.

            I wrote some very simple tests to check lock mode compatibility. Unfortunately two of the stress tests are failing:

            1. X_S:

              ...

            ANSWER

            Answered 2018-Oct-04 at 07:16

            Your tests pass when run against jcstress 0.3. In version 0.4 the behaviour changed to include the results of the sanity checks that are run on startup (see this commit against the bug jcstress omits samples gathered during sanity checks).

            Some of the sanity checks run in a single thread, and your test doesn't handle the case where both actors are called by the same thread; you're testing a reentrant lock, so the read lock will pass if the write lock is already held.

            This is arguably a bug in jcstress, as the documentation on @Actor says the invariants are:

            • Each method is called only by one particular thread.
            • Each method is called exactly once per State instance.

            While the documentation is not that clearly worded, the generated source makes it clear that the intention is to run each actor in its own thread.

            One way to work around it would be to allow the single threaded case to pass:

            Source https://stackoverflow.com/questions/52502306

            QUESTION

            NullPointerException with log4j with maven
            Asked 2018-Jun-05 at 08:56

            I have main pom, and two modules (sub poms), first of them contains dependency to log4j. First module - some utility classes. Second - tests for first module (jcstress) that compiles to sub-jar using shade plugin. compilation works fine, but then run tests (second module), it fails with this error. I have to dependencies for log4j in first module and they are copied to second one:

            ...

            ANSWER

            Answered 2018-Jun-05 at 08:56

            Remove log4j dependency in your POM and Add this dependency

            Source https://stackoverflow.com/questions/50694489

            QUESTION

            A data race and safe publication
            Asked 2017-Sep-03 at 01:48
            @State
            @JCStressTest
            public class M {
                class A {
                    int f;
                    A() {
                        f = 42;
                    }
                }
                private A a;
            
                @Actor
                void actor1(){
                    a = new A();
                }
                @Actor
                void actor2(IntResult1 r){
                    r.r1 = 1;
                    if(a != null){
                        r.r1 = a.f;
                    }
                }
            }
            
            ...

            ANSWER

            Answered 2017-Sep-03 at 01:48

            I know that is is not obvious that I should see that output, but it's possible and I would like to see it.

            You are correct that your code does have a data race.

            (There is no happens-before chain between f = 42 and ... = a.f deducible under the rules set out in the JMM. Therefore, it is not guaranteed that a.f will always see the value 42.)

            However, the nature of this race is such that it will only occur in extremely rare scenarios. It would most likely require a system with multiple cores, and either high memory load or an involuntary thread context switch at just the wrong instant. And it would be dependent on the native code emitted by the JIT compiler1.

            Is there any JVM option (like XX:....) to enforce it?

            Unfortunately, no there isn't.

            1 - Note you cannot draw sound inferences from the bytecodes. The JIT compiler is allowed (by the JLS / JVMS) to reorder instructions including memory reads and writes provided that they don't violate the JMM rules. This is important for performance of multi-threaded code.

            Source https://stackoverflow.com/questions/46018808

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install jcstress

            You can download it from GitHub, Maven.
            You can use jcstress like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the jcstress component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            If you have the access to JDK Bug System, please submit the bug there:. If you don't have the access to JDK Bug System, submit the bug report at "Issues" here, and wait for maintainers to pick that up.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/openjdk/jcstress.git

          • CLI

            gh repo clone openjdk/jcstress

          • sshUrl

            git@github.com:openjdk/jcstress.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link