Project

General

Profile

Actions

Bug #844

closed

Interpreter wide IO deadlock

Added by coderrr (coderrr .) over 15 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
[ruby-core:20446]

Description

=begin
two threads reading from the same socket at same time produces race condition whichs locks interpreter

info at: http://coderrr.wordpress.com/2008/12/10/mri-io-deadlock/

code to repo:

require 'socket'

if this ever stops printing we're screwed

Thread.new{loop{p 1;sleep 0.5}}

s = Thread.new do
cli = TCPServer.new(3020).accept
loop { cli.write 'hi' }
end

sock = TCPSocket.new('localhost', 3020)
2.times do
Thread.new do
loop { sock.readpartial 1024 }
end
end

s.join
=end

Actions #1

Updated by matz (Yukihiro Matsumoto) over 15 years ago

=begin
Hi,

In message "Re: [ruby-core:20907] Re: [Bug #844] Interpreter wide IO deadlock"
on Sat, 27 Dec 2008 12:51:46 +0900, Tanaka Akira writes:

|> I investigated the problem.
|
|There is similar problem with write.

|Updated patch:
|
|% svn diff --diff-cmd diff -x '-u -p'
|Index: eval.c

Can you check in?

						matz.

=end

Actions #2

Updated by akr (Akira Tanaka) over 15 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r21165.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0