examples/core/thread.rb in polyphony-0.16 vs examples/core/thread.rb in polyphony-0.17
- old
+ new
@@ -16,11 +16,11 @@
puts "read blocking #{data.bytesize} bytes (#{Time.now - t0}s)"
end
def threaded
t0 = Time.now
- data = Polyphony::Thread.spawn { lengthy_op }.await
- X.times { Polyphony::Thread.spawn { lengthy_op }.await }
+ data = Polyphony::Thread.coproc { lengthy_op }.await
+ X.times { Polyphony::Thread.coproc { lengthy_op }.await }
puts "read threaded #{data.bytesize} bytes (#{Time.now - t0}s)"
end
blocking
threaded