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

Drop read thread #172

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Drop read thread #172

wants to merge 2 commits into from

Conversation

bgamari
Copy link
Collaborator

@bgamari bgamari commented Sep 26, 2022

Previously we would read events from the console in a separate thread
which would be killed after the needed event was read. There are a few
issues with this approach:

  • it is expensive, requiring the creation and destruction of a thread
    with every read event
  • it is racy, since the thread may be killed after an even has been
    read from the console but before it has been pushed to the event
    TChan
  • we may read too much: the read loop thread may read more input than
    Haskeline was supposed to read (see GHC #21047).

Previously we would read events from the console in a separate thread
which would be killed after the needed event was read. There are a few
issues with this approach:

 * it is expensive, requiring the creation and destruction of a thread
   with every read event
 * it is racy, since the thread may be killed after an even has been
   read from the console but before it has been pushed to the event
   TChan
 * we may read too much: the read loop thread may read more input than
   Haskeline was supposed to read (see GHC #21047).
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

Successfully merging this pull request may close these issues.

1 participant