GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Just awaking a Netty native pinned poller should return no I/O events · Issue #112 · franz1981/Netty-VirtualThread-Scheduler

Just awaking a Netty native pinned poller should return no I/O events #112

New issue
Copy link
New issue
Copy link
Closed
Closed
Just awaking a Netty native pinned poller should return no I/O events#112
Copy link

Description

@franz1981
franz1981
opened on May 24, 2026
Issue body actions

We should verify this assumption and eventually modify Netty or understand how to do it right.

Netty-VirtualThread-Scheduler/core/src/main/java/io/netty/loom/VirtualIoNativePollerEventLoopGroup.java

Line 158 in 34e3752

boolean hadVtWork = scheduler.maybeYield(ioEvents > 0);

And

https://github.com/franz1981/Netty-VirtualThread-Scheduler/blob/master/core/src/main/java/io/netty/loom/EventLoopScheduler.java#L270

Stealing (because of been awaken by another asking for help!), won't happen on wakeup at that cycle, but need another non blocking I/O poll (because the previous one appear to have performed some I/O while it didn't) which would return 0 - if lucky (and no I/O really happens in the meantime).

We probably need a way on Netty side to know if the only event was a wakeup one and return 0.
The same while there's actual I/O and we don't want wakeups to be part of the other I/O events reported.

In this regard all transports behave slightly differently e.g.

  ┌───────────┬────────────────────────────────┬──────────┐
  │ Transport │      Wakeup-only returns       │ Correct? │
  ├───────────┼────────────────────────────────┼──────────┤
  │ NIO       │ 0                              │ Yes      │
  ├───────────┼────────────────────────────────┼──────────┤
  │ Epoll     │ 1 (eventfd counted)            │ No       │
  ├───────────┼────────────────────────────────┼──────────┤
  │ io_uring  │ 1-2 (eventfd + timeout cancel) │ No       │
  └───────────┴────────────────────────────────┴──────────┘

Activity

  1. franz1981
    changed the title [-]Workstealing relies on the assumption that awaking a pinned poller w Netty return I/O events[/-] [+]Workstealing reliJust awaking a Netty native pinned poller should return no I/O events[/+] on May 24, 2026
  2. franz1981
    changed the title [-]Workstealing reliJust awaking a Netty native pinned poller should return no I/O events[/-] [+]Just awaking a Netty native pinned poller should return no I/O events[/+] on May 24, 2026
  3. franz1981 commented on May 25, 2026

    @franz1981
    franz1981
    on May 25, 2026
    OwnerAuthor
    More actions

    Thinking about this twice, let's say netty/netty#16848 is fixing this for BOTH timers AND wakeup(s): if the event loop return 0 in both cases, it will still trigger an attempt to perform work stealing, which hasn't been actively requested by any "overwhelmed" carrier.
    This is not great TBH, but is "kind of fine" the same, as we try correctly try to steal in 2 cases:

    • if we have NOTHING to do before blocking on I/O
    • if we have NOTHING to do on checkpoints (both using the same maybeYield)

    And effectively, a timer expiration (because of deadline reached) is still a checkpoint that:

    1. the carrier is alive
    2. if there's NOTHING to do (timer expiration apart), why not helping others?
  4. franz1981 commented on Jun 17, 2026

    @franz1981
    franz1981
    on Jun 17, 2026
    OwnerAuthor
    More actions

    netty/netty#16848 merged waiting to upgrade to the new Netty version

  5. franz1981
    closed this as completedon Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.