From: David Rodriguez Date: 2009-12-15T10:31:41+09:00 Subject: Multithread TCPServer not dequeueing packets Hi All I am moving a software from ruby 1.8.5 to 1.9.1. We have a multi thread TCP server and the code looks like: @csock = TCPServer.new(@host, port) @server_thread_id = Thread.new { server() } def server() while (session_sock = @csock.accept) worker_thread = Thread.new { handle_connection(session_sock)} end end But when I moved to 1.9.1, I downloaded 1.9.1p376, it accepted all the connections but sometimes some of then, the thread did not dequeue any packets after all. So I google and I found a bug http://redmine.ruby-lang.org/issues/show/1525 which seems related.So I applied the patch suggested on that thread (I attached the patch) and everything worked just fine after that. My question is: should I code the server in a different way to make it multithread safe using ruby 1.9.1? Thanks, David Rodriguez Attachments: http://www.ruby-forum.com/attachment/4322/vm_deadlock_fix.diff -- Posted via http://www.ruby-forum.com/.