ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:87040] Re: cross-thread IO#close semantics
Date: Tue, 15 May 2018 09:53:15 +0000	[thread overview]
Message-ID: <20180515095315.GA15909@dcvr> (raw)
In-Reply-To: <20180423133946.GA6019@dcvr>

Likewise, IO.copy_stream also fails to detect cross-thread
IO#close because it does not use waiting_fd infrastructure
in rb_thread_io_blocking_region.

```
r, w = IO.pipe
th = Thread.new do
  begin
    IO.copy_stream(r, '/dev/null')
  rescue => e
    warn [ e.class, e.message ].inspect
  end
end
sleep 0.1
r.close
th.join
```

Should I change IO.copy_stream and IO.select to avoid
stuck threads in these cases?

      reply	other threads:[~2018-05-15  9:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23 13:39 [ruby-core:86655] cross-thread IO#close semantics Eric Wong
2018-05-15  9:53 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180515095315.GA15909@dcvr \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).