> Ported from 7ac9ca128885c5dd561e6fbd6bbeaddb86d6264c to the latest upstream 
> fibers branch. Adapted to the current API which renamed 
> implRegister/implDeregister to implStartPoll/implStopPoll and added 
> Mode/EventFD/Cleaner/PollerGroup architecture.

Francesco Nigro has updated the pull request incrementally with one additional 
commit since the last revision:

  Fix edge-triggered epoll lost wakeup race in Poller
  
  When a sub-poller's epoll_wait returns an edge-triggered event but no
  VT is parked on that fd (map contains REGISTERED sentinel), the event
  is consumed and discarded. If a VT parks on the fd afterward, no new
  edge event fires because the fd is already in "ready" state, causing
  the VT to wait forever.
  
  Introduce a POLLED sentinel to distinguish "registered, no pending
  event" from "registered, event consumed while idle". When polled()
  finds no waiting VT, it sets POLLED instead of REGISTERED. When
  startPoll() finds POLLED, it self-unparks via LockSupport.unpark()
  so the caller's park() returns immediately and retries the read.
  
  Zero cost in the common case (VT parks before event). Only adds one
  unpark() in the rare race window.

-------------

Changes:
  - all: https://git.openjdk.org/loom/pull/223/files
  - new: https://git.openjdk.org/loom/pull/223/files/ae5a07be..1ac6dc35

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=loom&pr=223&range=01
 - incr: https://webrevs.openjdk.org/?repo=loom&pr=223&range=00-01

  Stats: 15 lines in 1 file changed: 9 ins; 0 del; 6 mod
  Patch: https://git.openjdk.org/loom/pull/223.diff
  Fetch: git fetch https://git.openjdk.org/loom.git pull/223/head:pull/223

PR: https://git.openjdk.org/loom/pull/223

Reply via email to