| Modifier and Type | Class and Description |
|---|---|
| pack-priv static enum | Poller.
Poller mode. |
| private abstract static class | Poller.
A group of poller threads that support virtual threads polling file descriptors. |
| private static class | Poller.
POLLER_PER_CARRIER poller group. |
| private static class | Poller.
SYSTEM_THREADS poller group. |
| private static class | Poller.
VTHREAD_POLLERS poller group. |
| Modifier and Type | Field and Description |
|---|---|
| private static final JavaLangAccess | |
| private final Map | |
| private Thread | |
| private static final Poller. | |
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract void | |
| private static Poller. | |
| pack-priv int | |
| 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 | |
| public static Poller | |
| pack-priv abstract int | Returns: >0 if file descriptors are polled, 0 if no file descriptor polledif positive then block for up to timeout)timeout milliseconds,
if zero then don't block, if -1 then block indefinitelyPoll 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 | |
| private static int | pollerCount(String propName, int defaultCount)
Reads the given property name to get the poller count. |
| private void | |
| 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 | |
| private void | |
| private void | |
| 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 | |
| private void | |
| private void | |
| public String | |
| private void | |
| pack-priv void | |
| public static List |
| JLA | back to summary |
|---|---|
| private static final JavaLangAccess JLA | |
| map | back to summary |
|---|---|
| private final Map<Integer, Thread> map | |
| owner | back to summary |
|---|---|
| private Thread owner
| |
| POLLER_GROUP | back to summary |
|---|---|
| private static final Poller. | |
| shutdown | back to summary |
|---|---|
| private volatile boolean shutdown | |
| Poller | back to summary |
|---|---|
| protected Poller() Initialize a Poller. | |
| close | back 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. | |
| createPollerGroup | back to summary |
|---|---|
| private static Poller. Create and return the PollerGroup. | |
| fdVal | back to summary |
|---|---|
| pack-priv int fdVal() Returns the poller's file descriptor to use when polling with the master poller.
| |
| implStartPoll | back 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. | |
| implStopPoll | back 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.
| |
| isShutdown | back to summary |
|---|---|
| pack-priv boolean isShutdown() Returns true if this poller is marked for shutdown. | |
| masterPoller | back to summary |
|---|---|
| public static Poller masterPoller() Return the master poller or null if there is no master poller. | |
| poll | back to summary |
|---|---|
| pack-priv abstract int poll(int timeout) throws IOException Poll for events. The
| |
| poll | back 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.
| |
| poll | back to summary |
|---|---|
| private void poll(int fdVal, long nanos, BooleanSupplier isOpen) throws IOException Parks the current thread until a file descriptor is ready. | |
| polled | back to summary |
|---|---|
| pack-priv final void polled(int fdVal) Callback by the poll method when a file descriptor is polled. | |
| pollerCount | back 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.
| |
| pollerLoop | back to summary |
|---|---|
| private void pollerLoop() Master polling loop. The | |
| pollSelector | back to summary |
|---|---|
| public static void pollSelector(int fdVal, long nanos) throws IOException Parks the current thread until a Selector's file descriptor is ready.
| |
| readPollers | back to summary |
|---|---|
| public static List Return the list of read pollers. | |
| setOwner | back to summary |
|---|---|
| private void setOwner() Sets the poller's thread owner. | |
| setShutdown | back to summary |
|---|---|
| private void setShutdown() Marks this poller for shutdown. | |
| startPoll | back 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. | |
| stopPoll | back to summary |
|---|---|
| public static void stopPoll(Thread thread) Unpark the given thread so that it stops polling. | |
| stopPoll | back to summary |
|---|---|
| private void stopPoll(int fdVal) throws IOException Deregister a file descriptor from the I/O event management facility. | |
| subPollerLoop | back to summary |
|---|---|
| private void subPollerLoop(Poller masterPoller) Sub-poller polling loop. The | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| wakeupAll | back to summary |
|---|---|
| private void wakeupAll() Unparks all threads waiting on a file descriptor registered with this poller. | |
| wakeupPoller | back to summary |
|---|---|
| pack-priv void wakeupPoller() throws IOException Wakeup the poller thread if blocked in poll so it can shutdown.
| |
| writePollers | back to summary |
|---|---|
| public static List Return the list of write pollers. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Poller. | 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. | 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. | 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. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Poller. | |
| public static Poller. |
| POLLER_PER_CARRIER | back to summary |
|---|---|
| public static final Poller. 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_THREADS | back to summary |
|---|---|
| public static final Poller. 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_POLLERS | back to summary |
|---|---|
| public static final Poller. 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). | |
| Mode | back to summary |
|---|---|
| private Mode() | |
| valueOf | back to summary |
|---|---|
| public static Poller. | |
| values | back to summary |
|---|---|
| public static Poller. | |
| Modifier and Type | Field and Description |
|---|---|
| private final PollerProvider |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static void | |
| pack-priv abstract 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 | |
| pack-priv abstract void | |
| protected final void | |
| pack-priv abstract List |
| provider | back to summary |
|---|---|
| private final PollerProvider provider | |
| PollerGroup | back to summary |
|---|---|
| pack-priv PollerGroup(PollerProvider provider) | |
| closeAll | back to summary |
|---|---|
| pack-priv static void closeAll(Poller... pollers) Close the given pollers. | |
| masterPoller | back to summary |
|---|---|
| pack-priv abstract Poller masterPoller() Return the master poller, or null if no master poller. | |
| poll | back 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. | |
| pollSelector | back to summary |
|---|---|
| pack-priv void pollSelector(int fdVal, long nanos) throws IOException Parks the current thread until a Selector's file descriptor is ready. | |
| provider | back to summary |
|---|---|
| pack-priv final PollerProvider provider() | |
| readPollers | back to summary |
|---|---|
| pack-priv abstract List Return the read pollers. | |
| start | back to summary |
|---|---|
| pack-priv abstract void start() Starts the poller group and any system-wide poller threads. | |
| startPlatformThread | back to summary |
|---|---|
| protected final void startPlatformThread(String name, Runnable task) Starts a platform thread to run the given task. | |
| writePollers | back to summary |
|---|---|
| pack-priv abstract List Return the write pollers. | |
| Modifier and Type | Class and Description |
|---|---|
| private static record |
| Modifier and Type | Field and Description |
|---|---|
| private static final TerminatingThreadLocal | |
| private final Poller | |
| private final Set | |
| private final Poller[] |
| Access | Constructor and Description |
|---|---|
| pack-priv | PollerPerCarrierPollerGroup(PollerProvider provider, int writePollerCount)
Create a PollerPerCarrierPollerGroup with the given number of write pollers. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| pack-priv Poller | masterPoller()
Implements abstract sun. 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. Parks the current thread until a file descriptor is ready for the given op. |
| pack-priv void | pollSelector(int fdVal, long nanos)
Overrides sun. Parks the current thread until a Selector's file descriptor is ready. |
| private Poller | |
| pack-priv List | readPollers()
Implements abstract sun. Return the read pollers. |
| pack-priv void | start()
Implements abstract sun. Starts the poller group and any system-wide poller threads. |
| private Poller | |
| private void | |
| private Poller | |
| pack-priv List | writePollers()
Implements abstract sun. Return the write pollers. |
| CARRIER_POLLER | back to summary |
|---|---|
| private static final TerminatingThreadLocal<Poller. | |
| masterPoller | back to summary |
|---|---|
| private final Poller masterPoller | |
| readPollers | back to summary |
|---|---|
| private final Set<Poller> readPollers | |
| writePollers | back to summary |
|---|---|
| private final Poller[] writePollers | |
| PollerPerCarrierPollerGroup | back to summary |
|---|---|
| pack-priv PollerPerCarrierPollerGroup(PollerProvider provider, int writePollerCount) throws IOException Create a PollerPerCarrierPollerGroup with the given number of write pollers. | |
| carrierTerminated | back to summary |
|---|---|
| private void carrierTerminated(Poller readPoller) Invoked by the carrier thread before it terminates. | |
| masterPoller | back to summary |
|---|---|
| pack-priv Poller masterPoller() Implements abstract sun. Doc from sun. Return the master poller, or null if no master poller.
| |
| poll | back to summary |
|---|---|
| pack-priv void poll(int fdVal, int event, long nanos, BooleanSupplier isOpen) throws IOException Implements abstract sun. Doc from sun. Parks the current thread until a file descriptor is ready for the given op.
| |
| pollSelector | back to summary |
|---|---|
| pack-priv void pollSelector(int fdVal, long nanos) throws IOException Overrides sun. Doc from sun. Parks the current thread until a Selector's file descriptor is ready.
| |
| readPoller | back to summary |
|---|---|
| private Poller readPoller() throws IOException Returns the read poller for the current carrier, starting it if required. | |
| readPollers | back to summary |
|---|---|
| pack-priv List Implements abstract sun. Doc from sun. Return the read pollers.
| |
| start | back to summary |
|---|---|
| pack-priv void start() Implements abstract sun. Doc from sun. Starts the poller group and any system-wide poller threads.
| |
| startReadPoller | back to summary |
|---|---|
| private Poller startReadPoller() throws IOException Starts a read sub-poller in a virtual thread. | |
| subPollerLoop | back to summary |
|---|---|
| private void subPollerLoop(Poller readPoller) Sub-poller polling loop. | |
| writePoller | back to summary |
|---|---|
| private Poller writePoller(int fdVal) | |
| writePollers | back to summary |
|---|---|
| pack-priv List Implements abstract sun. Doc from sun. Return the write pollers.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Poller. | |
| private final Poller | readPoller
Record Component accessed by readPoller(). |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public Poller. | |
| public final int | |
| public Poller | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| group | back to summary |
|---|---|
| private final Poller. Record Component accessed by group(). | |
| readPoller | back to summary |
|---|---|
| private final Poller readPoller Record Component accessed by readPoller(). | |
| CarrierPoller | back to summary |
|---|---|
| private CarrierPoller(Poller. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| group | back to summary |
|---|---|
| public Poller. Record Component getter of group. | |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| readPoller | back to summary |
|---|---|
| public Poller readPoller() Record Component getter of readPoller. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of 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. | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv Poller | masterPoller()
Implements abstract sun. 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. Parks the current thread until a file descriptor is ready for the given op. |
| private Poller | |
| pack-priv List | readPollers()
Implements abstract sun. Return the read pollers. |
| pack-priv void | start()
Implements abstract sun. Starts the poller group and any system-wide poller threads. |
| private Poller | |
| pack-priv List | writePollers()
Implements abstract sun. Return the write pollers. |
| readPollers | back to summary |
|---|---|
| private final Poller[] readPollers | |
| writePollers | back to summary |
|---|---|
| private final Poller[] writePollers | |
| SystemThreadsPollerGroup | back to summary |
|---|---|
| pack-priv SystemThreadsPollerGroup(PollerProvider provider, int readPollerCount, int writePollerCount) throws IOException | |
| masterPoller | back to summary |
|---|---|
| pack-priv Poller masterPoller() Implements abstract sun. Doc from sun. Return the master poller, or null if no master poller.
| |
| poll | back to summary |
|---|---|
| pack-priv void poll(int fdVal, int event, long nanos, BooleanSupplier isOpen) throws IOException Implements abstract sun. Doc from sun. Parks the current thread until a file descriptor is ready for the given op.
| |
| readPoller | back to summary |
|---|---|
| private Poller readPoller(int fdVal) | |
| readPollers | back to summary |
|---|---|
| pack-priv List Implements abstract sun. Doc from sun. Return the read pollers.
| |
| start | back to summary |
|---|---|
| pack-priv void start() Implements abstract sun. Doc from sun. Starts the poller group and any system-wide poller threads.
| |
| writePoller | back to summary |
|---|---|
| private Poller writePoller(int fdVal) | |
| writePollers | back to summary |
|---|---|
| pack-priv List Implements abstract sun. Doc from sun. Return the write pollers.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Executor | |
| private final Poller | |
| private final Poller[] | |
| private final Poller[] |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv Poller | masterPoller()
Implements abstract sun. 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. Parks the current thread until a file descriptor is ready for the given op. |
| pack-priv void | pollSelector(int fdVal, long nanos)
Overrides sun. Parks the current thread until a Selector's file descriptor is ready. |
| private Poller | |
| pack-priv List | readPollers()
Implements abstract sun. Return the read pollers. |
| pack-priv void | start()
Implements abstract sun. Starts the poller group and any system-wide poller threads. |
| private Poller | |
| pack-priv List | writePollers()
Implements abstract sun. Return the write pollers. |
| executor | back to summary |
|---|---|
| private final Executor executor | |
| masterPoller | back to summary |
|---|---|
| private final Poller masterPoller | |
| readPollers | back to summary |
|---|---|
| private final Poller[] readPollers | |
| writePollers | back to summary |
|---|---|
| private final Poller[] writePollers | |
| VThreadsPollerGroup | back to summary |
|---|---|
| pack-priv VThreadsPollerGroup(PollerProvider provider, int readPollerCount, int writePollerCount) throws IOException | |
| masterPoller | back to summary |
|---|---|
| pack-priv Poller masterPoller() Implements abstract sun. Doc from sun. Return the master poller, or null if no master poller.
| |
| poll | back to summary |
|---|---|
| pack-priv void poll(int fdVal, int event, long nanos, BooleanSupplier isOpen) throws IOException Implements abstract sun. Doc from sun. Parks the current thread until a file descriptor is ready for the given op.
| |
| pollSelector | back to summary |
|---|---|
| pack-priv void pollSelector(int fdVal, long nanos) throws IOException Overrides sun. Doc from sun. Parks the current thread until a Selector's file descriptor is ready.
| |
| readPoller | back to summary |
|---|---|
| private Poller readPoller(int fdVal) | |
| readPollers | back to summary |
|---|---|
| pack-priv List Implements abstract sun. Doc from sun. Return the read pollers.
| |
| start | back to summary |
|---|---|
| pack-priv void start() Implements abstract sun. Doc from sun. Starts the poller group and any system-wide poller threads.
| |
| writePoller | back to summary |
|---|---|
| private Poller writePoller(int fdVal) | |
| writePollers | back to summary |
|---|---|
| pack-priv List Implements abstract sun. Doc from sun. Return the write pollers.
| |