Skip to content

gets() hangs on Windows #256

Open
Open

Description

@emiltin

Hi,
Running this on Mac and Linux:

input, output = IO.pipe
Async do
  puts "starting"
  Async do
    puts "reading..."
    line = input.gets
    puts "got #{line.inspect}"
  end
  puts "writting..."
  output.puts "hello"
end

outputs:

starting
reading...
writting...
got "hello\n"

But on Windows it just outputs:

starting
reading...

and then hangs. It seems the call to input.gets()blocks?

I'm running the Windows code in a Github Workflow:
Microsoft Windows Server 2022, 10.0.20348
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x64-mingw-ucrt]
Using async 2.6.2
Using async-io 1.35.0
Using bundler 2.4.13

Activity

  1. emiltin commented on Aug 8, 2023

    @emiltin
    ContributorAuthor

    I cannot reproduce this with async 2.6.3, closing.

  2. ioquatix commented on Aug 8, 2023

    @ioquatix
    Member

    Wow great, thanks for reporting back!

  3. emiltin commented on Aug 10, 2023

    @emiltin
    ContributorAuthor

    It seems I was too quick to close this. The original example at the top still hangs on Windows.
    As mentioned, I'm running this in a GitHub Action, that runs a Ruby file with the example in.

    I'll try to make a PR with a new test.

  4. emiltin commented on Jun 12, 2024

    @emiltin
    ContributorAuthor

    Hi,
    Any plans for adding Windows to the test matrix? This seems still to hang on Windows.

  5. ioquatix commented on Jun 12, 2024

    @ioquatix
    Member

    Yes, but it's slow. I started writing support for IOCP in io-event gem.

  6. emiltin commented on Jun 12, 2024

    @emiltin
    ContributorAuthor

    Cool, thank you for the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions