Last active
December 24, 2023 11:46
Revisions
-
jpcamara revised this gist
Dec 24, 2023 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,6 +26,7 @@ def mkcdtmpdir w.write "foo" } } # Hangs indefinitely puts t1.wait end } -
jpcamara revised this gist
Dec 24, 2023 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,11 +5,11 @@ require "async" def mkcdtmpdir Dir.mktmpdir {|d| Dir.chdir(d) { yield } } end mkcdtmpdir { -
jpcamara created this gist
Dec 24, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ # hangs, same as MN threads # RUBY_MN_THREADS=1 make test-all TESTS="--name=TestIO#test_open_fifo_does_not_block_other_threads" require "tempfile" require "async" def mkcdtmpdir Dir.mktmpdir {|d| Dir.chdir(d) { yield } } end mkcdtmpdir { File.mkfifo("fifo") Async do |task| t1 = task.async { open("fifo", "r") {|r| r.read } } t2 = task.async { open("fifo", "w") {|w| w.write "foo" } } puts t1.wait end }