Earlier quoted context omitted.
It's not about feature / promise return types. Consider: int someFunc() { doA(); doB(); byte data[] = readFromSocket(); return doC(data); } int callerFunc() { doX(); System.out.println(someFunc()); doY(); } when we invoke the callerFunc() in a virtual thread, it executes till the potentially blocking socket reading, creates a callback or future -like object containing doC(), System.out.println(), doY() - such object…
Your examples are not functionally equivalent. In the first example the callers of both functions are blocked, in the second the callers are not blocked.
* FFI has to be pinned, so it will block