blocking-and-nonblocking-iolisted
Install: claude install-skill robsonkades/agent-skills
# Blocking and Non-Blocking I/O
## Purpose
Keep four distinct properties distinct, because every confused architecture argument about
virtual threads and reactive programming comes from collapsing them:
```text
Blocking API the caller may wait for this call's specified result
Blocked OS thread a kernel-schedulable entity is parked and unavailable
Non-blocking I/O no wait for readiness; partial progress or would-block is possible
Asynchronous model completion is represented separately, e.g. a stage or callback
```
A virtual thread reading a supported socket path without an enclosing pinning frame uses a
**blocking API**, does **not** dedicate a blocked carrier to that request, sits on top of
**non-blocking I/O** plus a shared poller in the current JDK implementation, and is written
in a **synchronous** model. All four at once. Any sentence that treats them as the same axis
is wrong somewhere.
Define what completion means before releasing resources: a read may return fewer bytes than
requested, and a streaming response may return before its body is consumed. Readiness, API
return, transfer completion and a remote business effect are different milestones; none alone
proves the others. The classification reference gives a concrete streaming example.
## Compatibility and evidence
Virtual-thread APIs require Java 21 (standard, no preview flags). Implementation guidance
here targets HotSpot JDK 21–25; the monitor behavior changes at JDK 24. Before applyin