Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Handles on Windows #14

Open
yoshuawuyts opened this issue Apr 24, 2020 · 7 comments
Open

Support for Handles on Windows #14

yoshuawuyts opened this issue Apr 24, 2020 · 7 comments

Comments

@yoshuawuyts
Copy link
Member

Windows has two kinds file descriptors: Handle and Socket. It seems smol::Async currently only support Socket but not yet Handle, which is needed to abstract over APIs such as named pipes. What is the plan for Handle-based APIs in smol?

@sdroege
Copy link
Contributor

sdroege commented Apr 25, 2020

Similar to fds on UNIX this has the problem that not all Handles are waitable from what I understand, so that would have to be documented carefully. For all others, WaitForMultipleObjects() and friends would work.

IMHO this would be useful to have.

@sdroege
Copy link
Contributor

sdroege commented Apr 25, 2020

To add some more information here, this is not just named pipes but also for example: waitable timers (basically Windows' timerfd equivalent), event objects, semaphores, threads/processes, mutexes and probably various other things I forgot.

@sdroege
Copy link
Contributor

sdroege commented Apr 25, 2020

wepoll only seems to support SOCKET unfortunately, so might not be a good choice going forward unless it gets support for HANDLE.

@ghost
Copy link

ghost commented Apr 25, 2020

I think we could eventually add support for RawHandle through IOCP... but it's not at the top of my priority list, tbh.

@sdroege
Copy link
Contributor

sdroege commented Apr 25, 2020

Makes sense and it's would only require internal changes anyway, not API-wise :)

@ghost ghost transferred this issue from smol-rs/smol Aug 22, 2020
@cr1901
Copy link

cr1901 commented Jan 12, 2024

To add some more information here, this is not just named pipes but also for example: waitable timers (basically Windows' timerfd equivalent), event objects, semaphores, threads/processes, mutexes and probably various other things I forgot.

This isn't really a deal-breaker, but I was looking to play with reading Physical Disks using OVERLAPPED_IO. Not anything (that) useful, just something for-fun that I could use to help learn how async-io works.

Unfortunately, because there's no support for Handles, I can't actually open a Physical Disk to pass to Async to take care of "all the stuff that I don't feel like writing myself" :P.

@notgull
Copy link
Member

notgull commented Jan 12, 2024

Usage as you describe is currently blocked on smol-rs/polling#97. But, waitable handles like processes can be used in #152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants