Tencent / TencentKona-8

Tencent Kona is a no-cost, production-ready distribution of the Open Java Development Kit (OpenJDK), Long-term support(LTS) with quarterly updates. Tencent Kona serves as the default JDK internally at Tencent Cloud for cloud computing and other Java applications.
Other
938 stars 146 forks source link

My feature branch #124

Closed HangerLIN closed 1 year ago

HangerLIN commented 1 year ago

Transplant jmh test Ring.java from Loom

changes:

  1. Add jmh dependencies in pom.xml

         <dependencies>
             <dependency>
                 <groupId>org.openjdk.jmh</groupId>
                 <artifactId>jmh-core</artifactId>
                 <version>1.23</version>
             </dependency>
             <dependency>
                 <groupId>org.openjdk.jmh</groupId>
                 <artifactId>jmh-generator-annprocess</artifactId>
                 <version>1.23</version>
             </dependency>
         </dependencies>
  2. Altered the Method for Starting Workers:

    • In the Loom version, the startAll() method was using Thread.startVirtualThread(w); to start virtual threads.
    • In the Kona version, in the same method I use Thread.ofVirtual().scheduler(Executors.newSingleThreadExecutor()).start(w); to start the virtual threads as well.
  3. Modified Channel Creation:

    • In the Loom version, the getChannel() method used the enhanced switch expression syntax:
      return switch(stackFrame) {
      ...
      default -> throw new RuntimeException("Illegal stack parameter value: "+ stackFrame +" (allowed: 1,2,4,8)");
      };
    • In the Kona version, I changed it back to the conventional switch statement since the arrow syntax used in “switch” only can be complied in jdk 14 or other later version.
      switch (stackFrame) {
      ...
      default:
       throw new RuntimeException("Illegal stack parameter value: " + stackFrame + " (allowed: 1,2,4,8)");
      }
tencent-adm commented 1 year ago

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
6 out of 7 committers have signed the CLA.

:white_check_mark: miao-zheng
:white_check_mark: ldaxr
:white_check_mark: huishi-hs
:white_check_mark: jun0315
:white_check_mark: johnshajiang
:white_check_mark: HangerLIN
:x: itwaix
You have signed the CLA already but the status is still pending? Let us recheck it.

johnshajiang commented 1 year ago

@HangerLIN I suppose you also find that this PR contains so many commits.

The target branch is KonaFiber instead of master. You may need to submit a new PR.