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

Multithreaded behavior of Poll #673

Closed
dtolnay opened this Issue Aug 18, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@dtolnay
Copy link

dtolnay commented Aug 18, 2017

Question from i.r-l.o:

Can multiple threads call poll on the same Poll? What happens? The documentation says nothing.

@frehberg

This comment has been minimized.

Copy link
Contributor

frehberg commented Sep 14, 2017

Is this question related to libc::poll or mio.Poll?
Neither one implements the reactor pattern (multiple threads polling same set of sockets) but are thin layers around the OS API for socket-IO.

Most underlying socket-APIs of the OS (Linux/Windows, etc.) support ::poll for read evnets from one thread and ::poll for write-events from another thread. But I am not sure if this would fit into ownership model for sockets in Rust.

@JohnColanduoni

This comment has been minimized.

Copy link

JohnColanduoni commented Nov 10, 2017

Is there a reason that mio::Poll protects poll() with a lock? Both epoll and kqueue are fine with concurrent epoll_wait/kevent calls on the same epoll descriptor/kqueue.

@carllerche

This comment has been minimized.

Copy link
Owner

carllerche commented Nov 10, 2017

Relates to #759

@carllerche

This comment has been minimized.

Copy link
Owner

carllerche commented Nov 10, 2017

@JohnColanduoni Yes, there is a reason, poll does more than call epoll_wait

@carllerche

This comment has been minimized.

Copy link
Owner

carllerche commented Jan 13, 2019

Closing due to inactivity.

@carllerche carllerche closed this Jan 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.