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

Remove epoll() usage in LTX communication #11

Merged
merged 1 commit into from
Nov 29, 2023
Merged

Remove epoll() usage in LTX communication #11

merged 1 commit into from
Nov 29, 2023

Conversation

acerv
Copy link
Collaborator

@acerv acerv commented Nov 29, 2023

Using epoll() is a bad idea when asyncio is involved. The reason is that asyncio itself is using epoll() to implement concurrency, so we end up having 2 epoll() instances running in parallel. When we record a new file descriptor into an asyncio application, we supposed to use the asyncio.BaseEventLoop.add_reader() method which is, unfortunately, not working (by experience) with plain files.

For this reason, the current solution is to use threaded read() syscall which permits to execute reading operations, as well as keeping asyncio loop running in the background without killing UI or data acquisition.

Using epoll() is a bad idea when asyncio is involved. The reason is that
asyncio itself is using epoll() to implement concurrency, so we end up
having 2 epoll() instances running in parallel. When we record a new file
descriptor into an asyncio application, we supposed to use the
asyncio.BaseEventLoop.add_reader() method which is, unfortunately, not
working (by experience) with plain files.

For this reason, the current solution is to use threaded read() syscall
which permits to execute reading operations, as well as keeping asyncio
loop running in the background without killing UI or data acquisition.
@acerv acerv self-assigned this Nov 29, 2023
@acerv acerv added the bug Something isn't working label Nov 29, 2023
@acerv acerv linked an issue Nov 29, 2023 that may be closed by this pull request
@acerv acerv merged commit bcb2df8 into master Nov 29, 2023
24 checks passed
@acerv acerv deleted the remove_epoll branch November 29, 2023 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant