APIdia Launch Partner
Top Description Inners Constructors Methods
com.sun.management.internal

public Class VirtualThreadSchedulerImpls

extends Object
Class Inheritance
Imports
java.util.concurrent.Executor, .ForkJoinPool, javax.management.ObjectName, jdk.management.VirtualThreadSchedulerMXBean, jdk.internal.access.JavaLangAccess, .SharedSecrets, jdk.internal.vm.ContinuationSupport, sun.management.Util

Provides the implementation of the management interface for the JDK's default virtual thread scheduler.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private abstract static class
VirtualThreadSchedulerImpls.BaseVirtualThreadSchedulerImpl

Base implementation of VirtualThreadSchedulerMXBean.

private static class
VirtualThreadSchedulerImpls.BoundVirtualThreadSchedulerImpl

Implementation of VirtualThreadSchedulerMXBean when virtual threads are backed by platform threads.

private static class
VirtualThreadSchedulerImpls.VirtualThreadSchedulerImpl

Implementation of VirtualThreadSchedulerMXBean when virtual threads are implemented with continuations + scheduler.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static VirtualThreadSchedulerMXBean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

VirtualThreadSchedulerImplsback to summary
private VirtualThreadSchedulerImpls()

Method Detail

createback to summary
public static VirtualThreadSchedulerMXBean create()
com.sun.management.internal back to summary

private abstract Class VirtualThreadSchedulerImpls.BaseVirtualThreadSchedulerImpl

extends Object
implements VirtualThreadSchedulerMXBean
Class Inheritance
  • java.lang.Object
  • com.sun.management.internal.VirtualThreadSchedulerImpls.BaseVirtualThreadSchedulerImpl
All Implemented Interfaces
jdk.management.VirtualThreadSchedulerMXBean, java.lang.management.PlatformManagedObject
Known Direct Subclasses
com.sun.management.internal.VirtualThreadSchedulerImpls.VirtualThreadSchedulerImpl, com.sun.management.internal.VirtualThreadSchedulerImpls.BoundVirtualThreadSchedulerImpl

Base implementation of VirtualThreadSchedulerMXBean.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
append(StringBuilder sb, String name, long value)

public final ObjectName
getObjectName()

Implements java.lang.management.PlatformManagedObject.getObjectName.

Returns an ObjectName instance representing the object name of this platform managed object.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Constructor Detail

BaseVirtualThreadSchedulerImplback to summary
private BaseVirtualThreadSchedulerImpl()

Method Detail

appendback to summary
private void append(StringBuilder sb, String name, long value)
getObjectNameback to summary
public final ObjectName getObjectName()

Implements java.lang.management.PlatformManagedObject.getObjectName.

Doc from java.lang.management.PlatformManagedObject.getObjectName.

Returns an ObjectName instance representing the object name of this platform managed object.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
com.sun.management.internal back to summary

private final Class VirtualThreadSchedulerImpls.BoundVirtualThreadSchedulerImpl

extends BaseVirtualThreadSchedulerImpl
Class Inheritance

Implementation of VirtualThreadSchedulerMXBean when virtual threads are backed by platform threads.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
getMountedVirtualThreadCount()

Implements jdk.management.VirtualThreadSchedulerMXBean.getMountedVirtualThreadCount.

Returns an estimate of the number of virtual threads that are currently mounted by the scheduler; -1 if not known.

public int
getParallelism()

Implements jdk.management.VirtualThreadSchedulerMXBean.getParallelism.

Returns the scheduler's target parallelism.

public int
getPoolSize()

Implements jdk.management.VirtualThreadSchedulerMXBean.getPoolSize.

Returns the current number of platform threads that the scheduler has started but have not terminated; -1 if not known.

public long
getQueuedVirtualThreadCount()

Implements jdk.management.VirtualThreadSchedulerMXBean.getQueuedVirtualThreadCount.

Returns an estimate of the number of virtual threads that are queued to the scheduler to start or continue execution; -1 if not known.

public void
setParallelism(int size)

Implements jdk.management.VirtualThreadSchedulerMXBean.setParallelism.

Sets the scheduler's target parallelism.

Inherited from com.sun.management.internal.VirtualThreadSchedulerImpls.BaseVirtualThreadSchedulerImpl:
getObjectNametoString

Constructor Detail

BoundVirtualThreadSchedulerImplback to summary
private BoundVirtualThreadSchedulerImpl()

Method Detail

getMountedVirtualThreadCountback to summary
public int getMountedVirtualThreadCount()

Implements jdk.management.VirtualThreadSchedulerMXBean.getMountedVirtualThreadCount.

Doc from jdk.management.VirtualThreadSchedulerMXBean.getMountedVirtualThreadCount.

Returns an estimate of the number of virtual threads that are currently mounted by the scheduler; -1 if not known.

The number of mounted virtual threads is equal to the number of platform threads carrying virtual threads.

Annotations
@Override
getParallelismback to summary
public int getParallelism()

Implements jdk.management.VirtualThreadSchedulerMXBean.getParallelism.

Doc from jdk.management.VirtualThreadSchedulerMXBean.getParallelism.

Returns the scheduler's target parallelism.

Annotations
@Override
getPoolSizeback to summary
public int getPoolSize()

Implements jdk.management.VirtualThreadSchedulerMXBean.getPoolSize.

Doc from jdk.management.VirtualThreadSchedulerMXBean.getPoolSize.

Returns the current number of platform threads that the scheduler has started but have not terminated; -1 if not known.

The count includes the platform threads that are currently carrying virtual threads and the platform threads that are not currently carrying virtual threads. The thread count may be greater than the scheduler's target parallelism.

Annotations
@Override
getQueuedVirtualThreadCountback to summary
public long getQueuedVirtualThreadCount()

Implements jdk.management.VirtualThreadSchedulerMXBean.getQueuedVirtualThreadCount.

Doc from jdk.management.VirtualThreadSchedulerMXBean.getQueuedVirtualThreadCount.

Returns an estimate of the number of virtual threads that are queued to the scheduler to start or continue execution; -1 if not known.

Annotations
@Override
setParallelismback to summary
public void setParallelism(int size)

Implements jdk.management.VirtualThreadSchedulerMXBean.setParallelism.

Doc from jdk.management.VirtualThreadSchedulerMXBean.setParallelism.

Sets the scheduler's target parallelism.

Increasing the target parallelism allows the scheduler to use more platform threads to carry virtual threads if required. Decreasing the target parallelism reduces the number of threads that the scheduler may use to carry virtual threads.

Annotations
@Override
com.sun.management.internal back to summary

private final Class VirtualThreadSchedulerImpls.VirtualThreadSchedulerImpl

extends BaseVirtualThreadSchedulerImpl
Class Inheritance

Implementation of VirtualThreadSchedulerMXBean when virtual threads are implemented with continuations + scheduler.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
getMountedVirtualThreadCount()

Implements jdk.management.VirtualThreadSchedulerMXBean.getMountedVirtualThreadCount.

Returns an estimate of the number of virtual threads that are currently mounted by the scheduler; -1 if not known.

public int
getParallelism()

Implements jdk.management.VirtualThreadSchedulerMXBean.getParallelism.

Returns the scheduler's target parallelism.

public int
getPoolSize()

Implements jdk.management.VirtualThreadSchedulerMXBean.getPoolSize.

Returns the current number of platform threads that the scheduler has started but have not terminated; -1 if not known.

public long
getQueuedVirtualThreadCount()

Implements jdk.management.VirtualThreadSchedulerMXBean.getQueuedVirtualThreadCount.

Returns an estimate of the number of virtual threads that are queued to the scheduler to start or continue execution; -1 if not known.

public void
setParallelism(int size)

Implements jdk.management.VirtualThreadSchedulerMXBean.setParallelism.

Sets the scheduler's target parallelism.

Inherited from com.sun.management.internal.VirtualThreadSchedulerImpls.BaseVirtualThreadSchedulerImpl:
getObjectNametoString

Constructor Detail

VirtualThreadSchedulerImplback to summary
private VirtualThreadSchedulerImpl()

Method Detail

getMountedVirtualThreadCountback to summary
public int getMountedVirtualThreadCount()

Implements jdk.management.VirtualThreadSchedulerMXBean.getMountedVirtualThreadCount.

Doc from jdk.management.VirtualThreadSchedulerMXBean.getMountedVirtualThreadCount.

Returns an estimate of the number of virtual threads that are currently mounted by the scheduler; -1 if not known.

The number of mounted virtual threads is equal to the number of platform threads carrying virtual threads.

Annotations
@Override
getParallelismback to summary
public int getParallelism()

Implements jdk.management.VirtualThreadSchedulerMXBean.getParallelism.

Doc from jdk.management.VirtualThreadSchedulerMXBean.getParallelism.

Returns the scheduler's target parallelism.

Annotations
@Override
getPoolSizeback to summary
public int getPoolSize()

Implements jdk.management.VirtualThreadSchedulerMXBean.getPoolSize.

Doc from jdk.management.VirtualThreadSchedulerMXBean.getPoolSize.

Returns the current number of platform threads that the scheduler has started but have not terminated; -1 if not known.

The count includes the platform threads that are currently carrying virtual threads and the platform threads that are not currently carrying virtual threads. The thread count may be greater than the scheduler's target parallelism.

Annotations
@Override
getQueuedVirtualThreadCountback to summary
public long getQueuedVirtualThreadCount()

Implements jdk.management.VirtualThreadSchedulerMXBean.getQueuedVirtualThreadCount.

Doc from jdk.management.VirtualThreadSchedulerMXBean.getQueuedVirtualThreadCount.

Returns an estimate of the number of virtual threads that are queued to the scheduler to start or continue execution; -1 if not known.

Annotations
@Override
setParallelismback to summary
public void setParallelism(int size)

Implements jdk.management.VirtualThreadSchedulerMXBean.setParallelism.

Doc from jdk.management.VirtualThreadSchedulerMXBean.setParallelism.

Sets the scheduler's target parallelism.

Increasing the target parallelism allows the scheduler to use more platform threads to carry virtual threads if required. Decreasing the target parallelism reduces the number of threads that the scheduler may use to carry virtual threads.

Annotations
@Override
com.sun.management.internal back to summary

private Class VirtualThreadSchedulerImpls.VirtualThreadSchedulerImpl.Scheduler

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.management.internal.VirtualThreadSchedulerImpls.VirtualThreadSchedulerImpl.Scheduler

Holder class for scheduler.

Field Summary

Modifier and TypeField and Description
private static final Executor

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static Executor
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

schedulerback to summary
private static final Executor scheduler

Constructor Detail

Schedulerback to summary
private Scheduler()

Method Detail

instanceback to summary
pack-priv static Executor instance()