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

Lack of new threads. #4

Open
twopieman opened this issue Dec 26, 2019 · 1 comment
Open

Lack of new threads. #4

twopieman opened this issue Dec 26, 2019 · 1 comment

Comments

@twopieman
Copy link

Please correct me if I am wrong since I am basically transitioning over from windows to linux and am slowly building my mental model around Linux.

This application seems to in a loop submit an IO request and then try and reap the completion on that same thread, this seems counter-intuitive to how i think async IO is meant to be used. Ideally you would have a thread\ bunch of threads perform I/O's or submit I/O's (in Linux AIO jargon) and then have a separate pool of threads reaping the I/O completions. The way this sample application is written it simply performs the I/O in a very synchronous manner even though it is using Linux AIO under the covers.

I am interested in your thoughts around this.

@littledan
Copy link
Owner

I believe Linux AIO is threadsafe: you can submit requests from several threads on the same io_context_t. However, you can also use just one thread, and the I/O will be done in parallel. Both are valid patterns.

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

No branches or pull requests

2 participants