polling icon indicating copy to clipboard operation
polling copied to clipboard

DRAFT: trying to make add safe

Open keepsimple1 opened this issue 1 year ago • 2 comments
trafficstars

To follow up on the issue #191, I'm experimenting with some changes to make Poller::add safe.

Since I'm new to I/O Safety, I probably missed something or maybe totally wrong. But I wanted to post this PR to get comments and find out what I've missed at least.

This draft change only applied on macOS, i.e. kqueue as I'm trying to see if I was on the right direction. Thanks in advance.

keepsimple1 avatar Feb 15 '24 04:02 keepsimple1

I don't think it's possible to make add safe in the general case; the Windows and poll()-based backends can't be made safe. However it is possible to make it safe for certain backends.

notgull avatar Apr 22 '24 23:04 notgull

I don't think it's possible to make add safe in the general case; the Windows

What if we change RawSocket to BorrowedSocket in the following? Will that help? https://github.com/smol-rs/polling/blob/0b4afcaf0a61ee06087d77c490abf8802f91aeff/src/iocp/mod.rs#L174

and poll()-based backends can't be made safe. However it is possible to make it safe for certain backends.

Is it this one? (seems it is still / already safe?) https://github.com/smol-rs/polling/blob/0b4afcaf0a61ee06087d77c490abf8802f91aeff/src/poll.rs#L102

keepsimple1 avatar Apr 23 '24 05:04 keepsimple1