Windows Evented Io implementation?

pub const Evented = if (fiber.supported) switch (builtin.os.tag) {
    .linux => Uring,
    .dragonfly, .freebsd, .netbsd, .openbsd => Kqueue,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => Dispatch,
    else => void,
} else void; // context-switching code not implemented yet

在当前std.Io.Evented中,Linux、BSD、Macos or ios都有对应的Evented Io实现,但是Windows从开始到现在都是void,我提交了Windows IOCP的ntdll的代码,但是Andrew Kelley说让我讨论一下就知道为什么这些Windows IOCP的代码不能被接收,可能是我写的不对?还是说在Windows下不能用ICOP来实现std.Io的Evented?

As far as I can see, you added just the ntdll function declarations, not the actual IOCP implementation of std.Io. Zig has a policy to not have wrappers in std.os.windows, unless they are used. I don’t know enough about the dev process to tell if a full implementation would be accepted.

完整的IOCP实现我目前还没搞清楚具体怎么做,可能需要实现vtable,涉及到reader、writer、net等具体实现,可能是个庞杂的工程

Yes, the complete implementation will he a fairly complex project. If you are interested in tackling that, first discussing the details with the core team would make sense.

If you want to just use evented io on windows, not develop the io implementation, check our my “zio” project. I use regular winapi APIs, not ntdll.

2 Likes