APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.nio.ch

public abstract Class Poller

extends Object
Class Inheritance
Known Direct Subclasses
sun.nio.ch.EPollPoller
Imports
java.io.IOException, .UncheckedIOException, java.lang.ref.Reference, java.util.Arrays, .List, .Map, .Objects, .Set, java.util.concurrent.ConcurrentHashMap, .Executor, .Executors, .ThreadFactory, java.util.concurrent.locks.LockSupport, java.util.function.BooleanSupplier, jdk.internal.access.JavaLangAccess, .SharedSecrets, jdk.internal.misc.InnocuousThread, .TerminatingThreadLocal, jdk.internal.vm.Continuation, .ContinuationSupport, jdk.internal.vm.annotation.Stable

I/O poller to allow virtual threads park until a file descriptor is ready for I/O.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum
Poller.Mode

Poller mode.

private abstract static class
Poller.PollerGroup

A group of poller threads that support virtual threads polling file descriptors.

private static class
Poller.PollerPerCarrierPollerGroup

POLLER_PER_CARRIER poller group.

private static class
Poller.SystemThreadsPollerGroup

SYSTEM_THREADS poller group.

private static class
Poller.VThreadsPollerGroup

VTHREAD_POLLERS poller group.

Field Summary

Modifier and TypeField and Description
private static final JavaLangAccess
private final Map<Integer, Thread>
private Thread
private static final Poller.PollerGroup
private volatile boolean

Constructor Summary

AccessConstructor and Description
protected
Poller()

Initialize a Poller.

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract void
close()

Closes the poller and release resources.

private static Poller.PollerGroup
createPollerGroup()

Create and return the PollerGroup.

pack-priv int
fdVal()

Returns the poller's file descriptor to use when polling with the master poller.

pack-priv abstract void
implStartPoll(int fdVal)

Register the file descriptor with the I/O event management facility so that it is polled when the file descriptor is ready for I/O.

pack-priv abstract void
implStopPoll(int fdVal, boolean
true if the file descriptor has already been polled
polled
)

Deregister a file descriptor from the I/O event management facility.

pack-priv boolean
isShutdown()

Returns true if this poller is marked for shutdown.

public static Poller
masterPoller()

Return the master poller or null if there is no master poller.

pack-priv abstract int

Returns:

>0 if file descriptors are polled, 0 if no file descriptor polled
poll
(int
if positive then block for up to timeout milliseconds, if zero then don't block, if -1 then block indefinitely
timeout
)

Poll for events.

public static void
poll(int
the file descriptor
fdVal
,
int
POLLIN or POLLOUT
event
,
long
the waiting time or 0 to wait indefinitely
nanos
,
BooleanSupplier
supplies a boolean to indicate if the enclosing object is open
isOpen
)

Parks the current thread until a file descriptor is ready for the given op.

private void
poll(int fdVal, long nanos, BooleanSupplier isOpen)

Parks the current thread until a file descriptor is ready.

pack-priv final void
polled(int fdVal)

Callback by the poll method when a file descriptor is polled.

private static int
pollerCount(String propName, int defaultCount)

Reads the given property name to get the poller count.

private void
pollerLoop()

Master polling loop.

public static void
pollSelector(int
the Selector's file descriptor
fdVal
,
long
the waiting time or 0 to wait indefinitely
nanos
)

Parks the current thread until a Selector's file descriptor is ready.

public static List<Poller>
readPollers()

Return the list of read pollers.

private void
setOwner()

Sets the poller's thread owner.

private void
setShutdown()

Marks this poller for shutdown.

private void
startPoll(int fdVal)

Register a file descriptor with the I/O event management facility so that it is polled when the file descriptor is ready for I/O.

public static void
stopPoll(Thread thread)

Unpark the given thread so that it stops polling.

private void
stopPoll(int fdVal)

Deregister a file descriptor from the I/O event management facility.

private void
subPollerLoop(Poller masterPoller)

Sub-poller polling loop.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

private void
wakeupAll()

Unparks all threads waiting on a file descriptor registered with this poller.

pack-priv void
wakeupPoller()

Wakeup the poller thread if blocked in poll so it can shutdown.

public static List<Poller>
writePollers()

Return the list of write pollers.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

JLAback to summary
private static final JavaLangAccess JLA
mapback to summary
private final Map<Integer, Thread> map
ownerback to summary
private Thread owner
Annotations
@Stable
POLLER_GROUPback to summary
private static final Poller.PollerGroup POLLER_GROUP
shutdownback to summary
private volatile boolean shutdown

Constructor Detail

Pollerback to summary
protected Poller()

Initialize a Poller.

Method Detail

closeback to summary
pack-priv abstract void close() throws IOException

Closes the poller and release resources. This method can only be used to cleanup when creating a poller group fails.

createPollerGroupback to summary
private static Poller.PollerGroup createPollerGroup()

Create and return the PollerGroup.

fdValback to summary
pack-priv int fdVal()

Returns the poller's file descriptor to use when polling with the master poller.

Exceptions
UnsupportedOperationException:
if not supported
implStartPollback to summary
pack-priv abstract void implStartPoll(int fdVal) throws IOException

Register the file descriptor with the I/O event management facility so that it is polled when the file descriptor is ready for I/O. The registration is "one shot", meaning it should be polled at most once.

implStopPollback to summary
pack-priv abstract void implStopPoll(int fdVal, boolean polled) throws IOException

Deregister a file descriptor from the I/O event management facility. This may be a no-op in some implementations when the file descriptor has already been polled.

Parameters
polled:boolean

true if the file descriptor has already been polled

isShutdownback to summary
pack-priv boolean isShutdown()

Returns true if this poller is marked for shutdown.

masterPollerback to summary
public static Poller masterPoller()

Return the master poller or null if there is no master poller.

pollback to summary
pack-priv abstract int poll(int timeout) throws IOException

Poll for events. The polled(int) method is invoked for each polled file descriptor.

Parameters
timeout:int

if positive then block for up to timeout milliseconds, if zero then don't block, if -1 then block indefinitely

Returns:int

>0 if file descriptors are polled, 0 if no file descriptor polled

pollback to summary
public static void poll(int fdVal, int event, long nanos, BooleanSupplier isOpen) throws IOException

Parks the current thread until a file descriptor is ready for the given op.

Parameters
fdVal:int

the file descriptor

event:int

POLLIN or POLLOUT

nanos:long

the waiting time or 0 to wait indefinitely

isOpen:BooleanSupplier

supplies a boolean to indicate if the enclosing object is open

pollback to summary
private void poll(int fdVal, long nanos, BooleanSupplier isOpen) throws IOException

Parks the current thread until a file descriptor is ready.

polledback to summary
pack-priv final void polled(int fdVal)

Callback by the poll method when a file descriptor is polled.

pollerCountback to summary
private static int pollerCount(String propName, int defaultCount)

Reads the given property name to get the poller count. If the property is set then the value must be a power of 2. Returns 1 if the property is not set.

Exceptions
IllegalArgumentException:
if the property is set to a value that is not a power of 2.
pollerLoopback to summary
private void pollerLoop()

Master polling loop. The polled(int) method is invoked for each file descriptor that is polled.

pollSelectorback to summary
public static void pollSelector(int fdVal, long nanos) throws IOException

Parks the current thread until a Selector's file descriptor is ready.

Parameters
fdVal:int

the Selector's file descriptor

nanos:long

the waiting time or 0 to wait indefinitely

readPollersback to summary
public static List<Poller> readPollers()

Return the list of read pollers.

setOwnerback to summary
private void setOwner()

Sets the poller's thread owner.

setShutdownback to summary
private void setShutdown()

Marks this poller for shutdown.

startPollback to summary
private void startPoll(int fdVal) throws IOException

Register a file descriptor with the I/O event management facility so that it is polled when the file descriptor is ready for I/O.

stopPollback to summary
public static void stopPoll(Thread thread)

Unpark the given thread so that it stops polling.

stopPollback to summary
private void stopPoll(int fdVal) throws IOException

Deregister a file descriptor from the I/O event management facility.

subPollerLoopback to summary
private void subPollerLoop(Poller masterPoller)

Sub-poller polling loop. The polled(int) method is invoked for each file descriptor that is polled. The sub-poller registers its file descriptor with the master poller to park until there are events to poll. When unparked, it does non-blocking polls and parks again when there are no more events. The sub-poller yields after each poll to help with fairness and to avoid re-registering with the master poller where possible.

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
wakeupAllback to summary
private void wakeupAll()

Unparks all threads waiting on a file descriptor registered with this poller.

wakeupPollerback to summary
pack-priv void wakeupPoller() throws IOException

Wakeup the poller thread if blocked in poll so it can shutdown.

Exceptions
UnsupportedOperationException:
if not supported
writePollersback to summary
public static List<Poller> writePollers()

Return the list of write pollers.

sun.nio.ch back to summary

pack-priv final Enum Poller.Mode

extends Enum<Poller.Mode>
Class Inheritance

Poller mode.

Field Summary

Modifier and TypeField and Description
public static final Poller.Mode
POLLER_PER_CARRIER

Read pollers are per-carrier virtual threads that poll for events, yielding between polls and unparking virtual threads when file descriptors are ready for I/O.

public static final Poller.Mode
SYSTEM_THREADS

Read and write pollers are platform threads that block waiting for events and unpark virtual threads when file descriptors are ready for I/O.

public static final Poller.Mode
VTHREAD_POLLERS

Read and write pollers are virtual threads that poll for events, yielding between polls and unparking virtual threads when file descriptors are ready for I/O.

Constructor Summary

AccessConstructor and Description
private
Mode()

Method Summary

Modifier and TypeMethod and Description
public static Poller.Mode
public static Poller.Mode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

POLLER_PER_CARRIERback to summary
public static final Poller.Mode POLLER_PER_CARRIER

Read pollers are per-carrier virtual threads that poll for events, yielding between polls and unparking virtual threads when file descriptors are ready for I/O. If there are no events then the poller threads park until there are I/O events to poll. The write poller is a system-wide platform thread.

SYSTEM_THREADSback to summary
public static final Poller.Mode SYSTEM_THREADS

Read and write pollers are platform threads that block waiting for events and unpark virtual threads when file descriptors are ready for I/O.

VTHREAD_POLLERSback to summary
public static final Poller.Mode VTHREAD_POLLERS

Read and write pollers are virtual threads that poll for events, yielding between polls and unparking virtual threads when file descriptors are ready for I/O. If there are no events then the poller threads park until there are I/O events to poll. This mode helps to integrate polling with virtual thread scheduling. The approach is similar to the default scheme in "User-level Threading: Have Your Cake and Eat It Too" by Karsten and Barghi 2020 (https://dl.acm.org/doi/10.1145/3379483).

Constructor Detail

Modeback to summary
private Mode()

Method Detail

valueOfback to summary
public static Poller.Mode valueOf(String name)
valuesback to summary
public static Poller.Mode[] values()
sun.nio.ch back to summary

private abstract Class Poller.PollerGroup

extends Object
Class Inheritance
Known Direct Subclasses
sun.nio.ch.Poller.SystemThreadsPollerGroup, sun.nio.ch.Poller.VThreadsPollerGroup, sun.nio.ch.Poller.PollerPerCarrierPollerGroup

A group of poller threads that support virtual threads polling file descriptors.

Field Summary

Modifier and TypeField and Description
private final PollerProvider

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
closeAll(Poller... pollers)

Close the given pollers.

pack-priv abstract Poller
masterPoller()

Return the master poller, or null if no master poller.

pack-priv abstract void
poll(int fdVal, int event, long nanos, BooleanSupplier isOpen)

Parks the current thread until a file descriptor is ready for the given op.

pack-priv void
pollSelector(int fdVal, long nanos)

Parks the current thread until a Selector's file descriptor is ready.

pack-priv final PollerProvider
pack-priv abstract List<Poller>
readPollers()

Return the read pollers.

pack-priv abstract void
start()

Starts the poller group and any system-wide poller threads.

protected final void
startPlatformThread(String name, Runnable task)

Starts a platform thread to run the given task.

pack-priv abstract List<Poller>
writePollers()

Return the write pollers.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

providerback to summary
private final PollerProvider provider

Constructor Detail

PollerGroupback to summary
pack-priv PollerGroup(PollerProvider provider)

Method Detail

closeAllback to summary
pack-priv static void closeAll(Poller... pollers)

Close the given pollers.

masterPollerback to summary
pack-priv abstract Poller masterPoller()

Return the master poller, or null if no master poller.

pollback to summary
pack-priv abstract void poll(int fdVal, int event, long nanos, BooleanSupplier isOpen) throws IOException

Parks the current thread until a file descriptor is ready for the given op.

pollSelectorback to summary
pack-priv void pollSelector(int fdVal, long nanos) throws IOException

Parks the current thread until a Selector's file descriptor is ready.

providerback to summary
pack-priv final PollerProvider provider()
readPollersback to summary
pack-priv abstract List<Poller> readPollers()

Return the read pollers.

startback to summary
pack-priv abstract void start()

Starts the poller group and any system-wide poller threads.

startPlatformThreadback to summary
protected final void startPlatformThread(String name, Runnable task)

Starts a platform thread to run the given task.

writePollersback to summary
pack-priv abstract List<Poller> writePollers()

Return the write pollers.

sun.nio.ch back to summary

private Class Poller.PollerPerCarrierPollerGroup

extends PollerGroup
Class Inheritance

POLLER_PER_CARRIER poller group. The read poller is a per-carrier virtual thread. When a virtual thread polls a file descriptor for POLLIN, then it will use (almost always, not guaranteed) the read poller for its carrier. When a read poller needs to block then it registers with a system-wide "master poller" that runs in a dedicated platform thread. The read poller terminates if the carrier terminates. The write pollers are system-wide platform threads (usually one).

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record

Field Summary

Modifier and TypeField and Description
private static final TerminatingThreadLocal<Poller.PollerPerCarrierPollerGroup.CarrierPoller>
private final Poller
private final Set<Poller>
private final Poller[]

Constructor Summary

AccessConstructor and Description
pack-priv
PollerPerCarrierPollerGroup(PollerProvider provider, int writePollerCount)

Create a PollerPerCarrierPollerGroup with the given number of write pollers.

Method Summary

Modifier and TypeMethod and Description
private void
carrierTerminated(Poller readPoller)

Invoked by the carrier thread before it terminates.

pack-priv Poller
masterPoller()

Implements abstract sun.nio.ch.Poller.PollerGroup.masterPoller.

Return the master poller, or null if no master poller.

pack-priv void
poll(int fdVal, int event, long nanos, BooleanSupplier isOpen)

Implements abstract sun.nio.ch.Poller.PollerGroup.poll.

Parks the current thread until a file descriptor is ready for the given op.

pack-priv void
pollSelector(int fdVal, long nanos)

Overrides sun.nio.ch.Poller.PollerGroup.pollSelector.

Parks the current thread until a Selector's file descriptor is ready.

private Poller
readPoller()

Returns the read poller for the current carrier, starting it if required.

pack-priv List<Poller>
readPollers()

Implements abstract sun.nio.ch.Poller.PollerGroup.readPollers.

Return the read pollers.

pack-priv void
start()

Implements abstract sun.nio.ch.Poller.PollerGroup.start.

Starts the poller group and any system-wide poller threads.

private Poller
startReadPoller()

Starts a read sub-poller in a virtual thread.

private void
subPollerLoop(Poller readPoller)

Sub-poller polling loop.

private Poller
writePoller(int fdVal)

pack-priv List<Poller>
writePollers()

Implements abstract sun.nio.ch.Poller.PollerGroup.writePollers.

Return the write pollers.

Inherited from sun.nio.ch.Poller.PollerGroup:
closeAllproviderstartPlatformThread

Field Detail

CARRIER_POLLERback to summary
private static final TerminatingThreadLocal<Poller.PollerPerCarrierPollerGroup.CarrierPoller> CARRIER_POLLER
masterPollerback to summary
private final Poller masterPoller
readPollersback to summary
private final Set<Poller> readPollers
writePollersback to summary
private final Poller[] writePollers

Constructor Detail

PollerPerCarrierPollerGroupback to summary
pack-priv PollerPerCarrierPollerGroup(PollerProvider provider, int writePollerCount) throws IOException

Create a PollerPerCarrierPollerGroup with the given number of write pollers.

Method Detail

carrierTerminatedback to summary
private void carrierTerminated(Poller readPoller)

Invoked by the carrier thread before it terminates.

masterPollerback to summary
pack-priv Poller masterPoller()

Implements abstract sun.nio.ch.Poller.PollerGroup.masterPoller.

Doc from sun.nio.ch.Poller.PollerGroup.masterPoller.

Return the master poller, or null if no master poller.

Annotations
@Override
pollback to summary
pack-priv void poll(int fdVal, int event, long nanos, BooleanSupplier isOpen) throws IOException

Implements abstract sun.nio.ch.Poller.PollerGroup.poll.

Doc from sun.nio.ch.Poller.PollerGroup.poll.

Parks the current thread until a file descriptor is ready for the given op.

Annotations
@Override
pollSelectorback to summary
pack-priv void pollSelector(int fdVal, long nanos) throws IOException

Overrides sun.nio.ch.Poller.PollerGroup.pollSelector.

Doc from sun.nio.ch.Poller.PollerGroup.pollSelector.

Parks the current thread until a Selector's file descriptor is ready.

Annotations
@Override
readPollerback to summary
private Poller readPoller() throws IOException

Returns the read poller for the current carrier, starting it if required.

readPollersback to summary
pack-priv List<Poller> readPollers()

Implements abstract sun.nio.ch.Poller.PollerGroup.readPollers.

Doc from sun.nio.ch.Poller.PollerGroup.readPollers.

Return the read pollers.

Annotations
@Override
startback to summary
pack-priv void start()

Implements abstract sun.nio.ch.Poller.PollerGroup.start.

Doc from sun.nio.ch.Poller.PollerGroup.start.

Starts the poller group and any system-wide poller threads.

Annotations
@Override
startReadPollerback to summary
private Poller startReadPoller() throws IOException

Starts a read sub-poller in a virtual thread.

subPollerLoopback to summary
private void subPollerLoop(Poller readPoller)

Sub-poller polling loop.

writePollerback to summary
private Poller writePoller(int fdVal)
writePollersback to summary
pack-priv List<Poller> writePollers()

Implements abstract sun.nio.ch.Poller.PollerGroup.writePollers.

Doc from sun.nio.ch.Poller.PollerGroup.writePollers.

Return the write pollers.

Annotations
@Override
sun.nio.ch back to summary

private final Record Poller.PollerPerCarrierPollerGroup.CarrierPoller

extends Record
Class Inheritance
Record Components
group:Poller.PollerPerCarrierPollerGroup 
readPoller:Poller 

Field Summary

Modifier and TypeField and Description
private final Poller.PollerPerCarrierPollerGroup
group

Record Component accessed by group().

private final Poller
readPoller

Record Component accessed by readPoller().

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public Poller.PollerPerCarrierPollerGroup
group()

Record Component getter of group.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public Poller
readPoller()

Record Component getter of readPoller.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

groupback to summary
private final Poller.PollerPerCarrierPollerGroup group

Record Component accessed by group().

readPollerback to summary
private final Poller readPoller

Record Component accessed by readPoller().

Constructor Detail

CarrierPollerback to summary
private CarrierPoller(Poller.PollerPerCarrierPollerGroup group, Poller readPoller)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
groupback to summary
public Poller.PollerPerCarrierPollerGroup group()

Record Component getter of group.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

readPollerback to summary
public Poller readPoller()

Record Component getter of readPoller.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

sun.nio.ch back to summary

private Class Poller.SystemThreadsPollerGroup

extends PollerGroup
Class Inheritance

SYSTEM_THREADS poller group. The read and write pollers are system-wide platform threads.

Field Summary

Modifier and TypeField and Description
private final Poller[]
private final Poller[]

Constructor Summary

AccessConstructor and Description
pack-priv
SystemThreadsPollerGroup(PollerProvider provider, int readPollerCount, int writePollerCount)

Method Summary

Modifier and TypeMethod and Description
pack-priv Poller
masterPoller()

Implements abstract sun.nio.ch.Poller.PollerGroup.masterPoller.

Return the master poller, or null if no master poller.

pack-priv void
poll(int fdVal, int event, long nanos, BooleanSupplier isOpen)

Implements abstract sun.nio.ch.Poller.PollerGroup.poll.

Parks the current thread until a file descriptor is ready for the given op.

private Poller
readPoller(int fdVal)

pack-priv List<Poller>
readPollers()

Implements abstract sun.nio.ch.Poller.PollerGroup.readPollers.

Return the read pollers.

pack-priv void
start()

Implements abstract sun.nio.ch.Poller.PollerGroup.start.

Starts the poller group and any system-wide poller threads.

private Poller
writePoller(int fdVal)

pack-priv List<Poller>
writePollers()

Implements abstract sun.nio.ch.Poller.PollerGroup.writePollers.

Return the write pollers.

Inherited from sun.nio.ch.Poller.PollerGroup:
closeAllpollSelectorproviderstartPlatformThread

Field Detail

readPollersback to summary
private final Poller[] readPollers
writePollersback to summary
private final Poller[] writePollers

Constructor Detail

SystemThreadsPollerGroupback to summary
pack-priv SystemThreadsPollerGroup(PollerProvider provider, int readPollerCount, int writePollerCount) throws IOException

Method Detail

masterPollerback to summary
pack-priv Poller masterPoller()

Implements abstract sun.nio.ch.Poller.PollerGroup.masterPoller.

Doc from sun.nio.ch.Poller.PollerGroup.masterPoller.

Return the master poller, or null if no master poller.

Annotations
@Override
pollback to summary
pack-priv void poll(int fdVal, int event, long nanos, BooleanSupplier isOpen) throws IOException

Implements abstract sun.nio.ch.Poller.PollerGroup.poll.

Doc from sun.nio.ch.Poller.PollerGroup.poll.

Parks the current thread until a file descriptor is ready for the given op.

Annotations
@Override
readPollerback to summary
private Poller readPoller(int fdVal)
readPollersback to summary
pack-priv List<Poller> readPollers()

Implements abstract sun.nio.ch.Poller.PollerGroup.readPollers.

Doc from sun.nio.ch.Poller.PollerGroup.readPollers.

Return the read pollers.

Annotations
@Override
startback to summary
pack-priv void start()

Implements abstract sun.nio.ch.Poller.PollerGroup.start.

Doc from sun.nio.ch.Poller.PollerGroup.start.

Starts the poller group and any system-wide poller threads.

Annotations
@Override
writePollerback to summary
private Poller writePoller(int fdVal)
writePollersback to summary
pack-priv List<Poller> writePollers()

Implements abstract sun.nio.ch.Poller.PollerGroup.writePollers.

Doc from sun.nio.ch.Poller.PollerGroup.writePollers.

Return the write pollers.

Annotations
@Override
sun.nio.ch back to summary

private Class Poller.VThreadsPollerGroup

extends PollerGroup
Class Inheritance

VTHREAD_POLLERS poller group. The read and write pollers are virtual threads. When read and write pollers need to block then they register with a system-wide "master poller" that runs in a dedicated platform thread.

Field Summary

Modifier and TypeField and Description
private final Executor
private final Poller
private final Poller[]
private final Poller[]

Constructor Summary

AccessConstructor and Description
pack-priv
VThreadsPollerGroup(PollerProvider provider, int readPollerCount, int writePollerCount)

Method Summary

Modifier and TypeMethod and Description
pack-priv Poller
masterPoller()

Implements abstract sun.nio.ch.Poller.PollerGroup.masterPoller.

Return the master poller, or null if no master poller.

pack-priv void
poll(int fdVal, int event, long nanos, BooleanSupplier isOpen)

Implements abstract sun.nio.ch.Poller.PollerGroup.poll.

Parks the current thread until a file descriptor is ready for the given op.

pack-priv void
pollSelector(int fdVal, long nanos)

Overrides sun.nio.ch.Poller.PollerGroup.pollSelector.

Parks the current thread until a Selector's file descriptor is ready.

private Poller
readPoller(int fdVal)

pack-priv List<Poller>
readPollers()

Implements abstract sun.nio.ch.Poller.PollerGroup.readPollers.

Return the read pollers.

pack-priv void
start()

Implements abstract sun.nio.ch.Poller.PollerGroup.start.

Starts the poller group and any system-wide poller threads.

private Poller
writePoller(int fdVal)

pack-priv List<Poller>
writePollers()

Implements abstract sun.nio.ch.Poller.PollerGroup.writePollers.

Return the write pollers.

Inherited from sun.nio.ch.Poller.PollerGroup:
closeAllproviderstartPlatformThread

Field Detail

executorback to summary
private final Executor executor
masterPollerback to summary
private final Poller masterPoller
readPollersback to summary
private final Poller[] readPollers
writePollersback to summary
private final Poller[] writePollers

Constructor Detail

VThreadsPollerGroupback to summary
pack-priv VThreadsPollerGroup(PollerProvider provider, int readPollerCount, int writePollerCount) throws IOException

Method Detail

masterPollerback to summary
pack-priv Poller masterPoller()

Implements abstract sun.nio.ch.Poller.PollerGroup.masterPoller.

Doc from sun.nio.ch.Poller.PollerGroup.masterPoller.

Return the master poller, or null if no master poller.

Annotations
@Override
pollback to summary
pack-priv void poll(int fdVal, int event, long nanos, BooleanSupplier isOpen) throws IOException

Implements abstract sun.nio.ch.Poller.PollerGroup.poll.

Doc from sun.nio.ch.Poller.PollerGroup.poll.

Parks the current thread until a file descriptor is ready for the given op.

Annotations
@Override
pollSelectorback to summary
pack-priv void pollSelector(int fdVal, long nanos) throws IOException

Overrides sun.nio.ch.Poller.PollerGroup.pollSelector.

Doc from sun.nio.ch.Poller.PollerGroup.pollSelector.

Parks the current thread until a Selector's file descriptor is ready.

Annotations
@Override
readPollerback to summary
private Poller readPoller(int fdVal)
readPollersback to summary
pack-priv List<Poller> readPollers()

Implements abstract sun.nio.ch.Poller.PollerGroup.readPollers.

Doc from sun.nio.ch.Poller.PollerGroup.readPollers.

Return the read pollers.

Annotations
@Override
startback to summary
pack-priv void start()

Implements abstract sun.nio.ch.Poller.PollerGroup.start.

Doc from sun.nio.ch.Poller.PollerGroup.start.

Starts the poller group and any system-wide poller threads.

Annotations
@Override
writePollerback to summary
private Poller writePoller(int fdVal)
writePollersback to summary
pack-priv List<Poller> writePollers()

Implements abstract sun.nio.ch.Poller.PollerGroup.writePollers.

Doc from sun.nio.ch.Poller.PollerGroup.writePollers.

Return the write pollers.

Annotations
@Override