polyphony 0.45.0 → 0.46.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +2 -0
- data/.gitmodules +0 -0
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +38 -0
- data/Gemfile.lock +11 -3
- data/README.md +3 -3
- data/Rakefile +1 -1
- data/TODO.md +10 -18
- data/examples/adapters/redis_client.rb +3 -1
- data/examples/adapters/redis_pubsub_perf.rb +11 -8
- data/examples/adapters/sequel_mysql.rb +1 -1
- data/examples/adapters/sequel_pg.rb +24 -0
- data/examples/core/{02-awaiting-fibers.rb → await.rb} +0 -0
- data/examples/core/{xx-channels.rb → channels.rb} +0 -0
- data/examples/core/deferring-an-operation.rb +16 -0
- data/examples/core/{xx-erlang-style-genserver.rb → erlang-style-genserver.rb} +16 -9
- data/examples/core/{xx-forking.rb → forking.rb} +1 -1
- data/examples/core/handling-signals.rb +11 -0
- data/examples/core/{03-interrupting.rb → interrupt.rb} +0 -0
- data/examples/core/{xx-pingpong.rb → pingpong.rb} +7 -5
- data/examples/core/{xx-recurrent-timer.rb → recurrent-timer.rb} +1 -1
- data/examples/core/{xx-resource_delegate.rb → resource_delegate.rb} +3 -4
- data/examples/core/{01-spinning-up-fibers.rb → spin.rb} +1 -1
- data/examples/core/{xx-spin_error_backtrace.rb → spin_error_backtrace.rb} +1 -1
- data/examples/core/{xx-supervise-process.rb → supervise-process.rb} +8 -5
- data/examples/core/supervisor.rb +20 -0
- data/examples/core/{xx-thread-sleep.rb → thread-sleep.rb} +0 -0
- data/examples/core/{xx-thread_pool.rb → thread_pool.rb} +0 -0
- data/examples/core/{xx-throttling.rb → throttling.rb} +0 -0
- data/examples/core/{xx-timeout.rb → timeout.rb} +0 -0
- data/examples/core/{xx-using-a-mutex.rb → using-a-mutex.rb} +0 -0
- data/examples/core/{xx-worker-thread.rb → worker-thread.rb} +2 -2
- data/examples/io/{xx-backticks.rb → backticks.rb} +0 -0
- data/examples/io/{xx-echo_client.rb → echo_client.rb} +1 -1
- data/examples/io/{xx-echo_client_from_stdin.rb → echo_client_from_stdin.rb} +2 -2
- data/examples/io/{xx-echo_pipe.rb → echo_pipe.rb} +1 -1
- data/examples/io/{xx-echo_server.rb → echo_server.rb} +0 -0
- data/examples/io/{xx-echo_server_with_timeout.rb → echo_server_with_timeout.rb} +1 -1
- data/examples/io/{xx-echo_stdin.rb → echo_stdin.rb} +0 -0
- data/examples/io/{xx-happy-eyeballs.rb → happy-eyeballs.rb} +0 -0
- data/examples/io/{xx-httparty.rb → httparty.rb} +4 -13
- data/examples/io/{xx-irb.rb → irb.rb} +0 -0
- data/examples/io/{xx-net-http.rb → net-http.rb} +0 -0
- data/examples/io/{xx-open.rb → open.rb} +0 -0
- data/examples/io/{xx-pry.rb → pry.rb} +0 -0
- data/examples/io/{xx-rack_server.rb → rack_server.rb} +0 -0
- data/examples/io/raw.rb +14 -0
- data/examples/io/reline.rb +18 -0
- data/examples/io/{xx-system.rb → system.rb} +1 -1
- data/examples/io/{xx-tcpserver.rb → tcpserver.rb} +0 -0
- data/examples/io/{xx-tcpsocket.rb → tcpsocket.rb} +0 -0
- data/examples/io/tunnel.rb +6 -1
- data/examples/io/{xx-zip.rb → zip.rb} +0 -0
- data/examples/performance/fiber_transfer.rb +2 -1
- data/examples/performance/fs_read.rb +5 -6
- data/examples/performance/multi_snooze.rb +0 -1
- data/examples/{io/xx-switch.rb → performance/switch.rb} +2 -1
- data/examples/performance/thread-vs-fiber/{xx-httparty_multi.rb → httparty_multi.rb} +3 -4
- data/examples/performance/thread-vs-fiber/{xx-httparty_threaded.rb → httparty_threaded.rb} +0 -0
- data/examples/performance/thread-vs-fiber/polyphony_mt_server.rb +1 -1
- data/examples/performance/thread-vs-fiber/polyphony_server.rb +1 -2
- data/examples/performance/thread-vs-fiber/threaded_server.rb +1 -5
- data/examples/performance/thread_pool_perf.rb +6 -7
- data/ext/liburing/liburing.h +585 -0
- data/ext/liburing/liburing/README.md +4 -0
- data/ext/liburing/liburing/barrier.h +73 -0
- data/ext/liburing/liburing/compat.h +15 -0
- data/ext/liburing/liburing/io_uring.h +343 -0
- data/ext/liburing/queue.c +333 -0
- data/ext/liburing/register.c +187 -0
- data/ext/liburing/setup.c +210 -0
- data/ext/liburing/syscall.c +54 -0
- data/ext/liburing/syscall.h +18 -0
- data/ext/polyphony/backend.h +1 -16
- data/ext/polyphony/backend_common.h +109 -0
- data/ext/polyphony/backend_io_uring.c +884 -0
- data/ext/polyphony/backend_io_uring_context.c +73 -0
- data/ext/polyphony/backend_io_uring_context.h +52 -0
- data/ext/polyphony/{libev_backend.c → backend_libev.c} +255 -345
- data/ext/polyphony/event.c +1 -1
- data/ext/polyphony/extconf.rb +31 -13
- data/ext/polyphony/fiber.c +111 -27
- data/ext/polyphony/libev.c +4 -0
- data/ext/polyphony/libev.h +8 -2
- data/ext/polyphony/liburing.c +8 -0
- data/ext/polyphony/playground.c +51 -0
- data/ext/polyphony/polyphony.c +6 -8
- data/ext/polyphony/polyphony.h +29 -25
- data/ext/polyphony/polyphony_ext.c +13 -6
- data/ext/polyphony/queue.c +3 -4
- data/ext/polyphony/ring_buffer.c +0 -1
- data/ext/polyphony/runqueue.c +102 -0
- data/ext/polyphony/runqueue_ring_buffer.c +85 -0
- data/ext/polyphony/runqueue_ring_buffer.h +31 -0
- data/ext/polyphony/thread.c +45 -92
- data/lib/polyphony.rb +2 -2
- data/lib/polyphony/adapters/fs.rb +1 -1
- data/lib/polyphony/adapters/process.rb +0 -3
- data/lib/polyphony/adapters/redis.rb +1 -1
- data/lib/polyphony/adapters/trace.rb +2 -2
- data/lib/polyphony/core/global_api.rb +9 -12
- data/lib/polyphony/core/sync.rb +6 -2
- data/lib/polyphony/extensions/core.rb +6 -24
- data/lib/polyphony/extensions/debug.rb +13 -0
- data/lib/polyphony/extensions/fiber.rb +21 -44
- data/lib/polyphony/extensions/io.rb +55 -10
- data/lib/polyphony/extensions/socket.rb +70 -12
- data/lib/polyphony/version.rb +1 -1
- data/polyphony.gemspec +3 -2
- data/test/helper.rb +36 -4
- data/test/io_uring_test.rb +55 -0
- data/test/stress.rb +5 -2
- data/test/test_backend.rb +4 -6
- data/test/test_ext.rb +1 -2
- data/test/test_fiber.rb +31 -24
- data/test/test_global_api.rb +58 -31
- data/test/test_io.rb +58 -0
- data/test/test_signal.rb +11 -8
- data/test/test_socket.rb +17 -0
- data/test/test_sync.rb +21 -0
- data/test/test_throttler.rb +3 -6
- data/test/test_trace.rb +7 -5
- metadata +86 -76
- data/examples/adapters/concurrent-ruby.rb +0 -9
- data/examples/core/04-handling-signals.rb +0 -19
- data/examples/core/xx-at_exit.rb +0 -29
- data/examples/core/xx-backend.rb +0 -102
- data/examples/core/xx-caller.rb +0 -12
- data/examples/core/xx-daemon.rb +0 -14
- data/examples/core/xx-deadlock.rb +0 -8
- data/examples/core/xx-deferring-an-operation.rb +0 -14
- data/examples/core/xx-exception-backtrace.rb +0 -40
- data/examples/core/xx-fork-cleanup.rb +0 -22
- data/examples/core/xx-fork-spin.rb +0 -42
- data/examples/core/xx-fork-terminate.rb +0 -27
- data/examples/core/xx-move_on.rb +0 -23
- data/examples/core/xx-queue-async.rb +0 -120
- data/examples/core/xx-readpartial.rb +0 -18
- data/examples/core/xx-signals.rb +0 -16
- data/examples/core/xx-sleep-forever.rb +0 -9
- data/examples/core/xx-sleeping.rb +0 -25
- data/examples/core/xx-snooze-starve.rb +0 -16
- data/examples/core/xx-spin-fork.rb +0 -49
- data/examples/core/xx-state-machine.rb +0 -51
- data/examples/core/xx-stop.rb +0 -20
- data/examples/core/xx-supervisors.rb +0 -21
- data/examples/core/xx-thread-selector-sleep.rb +0 -51
- data/examples/core/xx-thread-selector-snooze.rb +0 -46
- data/examples/core/xx-thread-snooze.rb +0 -34
- data/examples/core/xx-timer-gc.rb +0 -17
- data/examples/core/xx-trace.rb +0 -79
- data/examples/performance/xx-array.rb +0 -11
- data/examples/performance/xx-fiber-switch.rb +0 -9
- data/examples/performance/xx-snooze.rb +0 -15
- data/examples/xx-spin.rb +0 -32
data/test/test_io.rb
CHANGED
@@ -92,6 +92,48 @@ class IOTest < MiniTest::Test
|
|
92
92
|
assert_raises(EOFError) { i.readpartial(1) }
|
93
93
|
end
|
94
94
|
|
95
|
+
def test_getc
|
96
|
+
i, o = IO.pipe
|
97
|
+
|
98
|
+
buf = []
|
99
|
+
f = spin do
|
100
|
+
while (c = i.getc)
|
101
|
+
buf << c
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
snooze
|
106
|
+
assert_equal [], buf
|
107
|
+
|
108
|
+
o << 'f'
|
109
|
+
snooze
|
110
|
+
o << 'g'
|
111
|
+
o.close
|
112
|
+
f.await
|
113
|
+
assert_equal ['f', 'g'], buf
|
114
|
+
end
|
115
|
+
|
116
|
+
def test_getbyte
|
117
|
+
i, o = IO.pipe
|
118
|
+
|
119
|
+
buf = []
|
120
|
+
f = spin do
|
121
|
+
while (b = i.getbyte)
|
122
|
+
buf << b
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
snooze
|
127
|
+
assert_equal [], buf
|
128
|
+
|
129
|
+
o << 'f'
|
130
|
+
snooze
|
131
|
+
o << 'g'
|
132
|
+
o.close
|
133
|
+
f.await
|
134
|
+
assert_equal [102, 103], buf
|
135
|
+
end
|
136
|
+
|
95
137
|
# see https://github.com/digital-fabric/polyphony/issues/30
|
96
138
|
def test_reopened_tempfile
|
97
139
|
file = Tempfile.new
|
@@ -246,4 +288,20 @@ class IOClassMethodsTest < MiniTest::Test
|
|
246
288
|
assert_equal 1e6, s.bytesize
|
247
289
|
assert s == IO.orig_read(fn)
|
248
290
|
end
|
291
|
+
|
292
|
+
def pipe_read
|
293
|
+
i, o = IO.pipe
|
294
|
+
yield o
|
295
|
+
o.close
|
296
|
+
i.read
|
297
|
+
ensure
|
298
|
+
i.close
|
299
|
+
end
|
300
|
+
|
301
|
+
def test_puts
|
302
|
+
assert_equal "foo\n", pipe_read { |f| f.puts 'foo' }
|
303
|
+
assert_equal "foo\n", pipe_read { |f| f.puts "foo\n" }
|
304
|
+
assert_equal "foo\nbar\n", pipe_read { |f| f.puts 'foo', 'bar' }
|
305
|
+
assert_equal "foo\nbar\n", pipe_read { |f| f.puts 'foo', "bar\n" }
|
306
|
+
end
|
249
307
|
end
|
data/test/test_signal.rb
CHANGED
@@ -3,18 +3,21 @@
|
|
3
3
|
require_relative 'helper'
|
4
4
|
|
5
5
|
class SignalTrapTest < Minitest::Test
|
6
|
+
def test_int_signal
|
7
|
+
Thread.new { sleep 0.001; Process.kill('INT', Process.pid) }
|
8
|
+
assert_raises(Interrupt) { sleep 5 }
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_term_signal
|
12
|
+
Thread.new { sleep 0.001; Process.kill('TERM', Process.pid) }
|
13
|
+
assert_raises(SystemExit) { sleep 5 }
|
14
|
+
end
|
15
|
+
|
6
16
|
def test_signal_exception_handling
|
7
17
|
i, o = IO.pipe
|
8
18
|
pid = Polyphony.fork do
|
9
19
|
i.close
|
10
|
-
|
11
|
-
spin do
|
12
|
-
sleep 5
|
13
|
-
rescue ::Interrupt => e
|
14
|
-
# the signal should be raised only in the main fiber
|
15
|
-
o.puts "1-interrupt"
|
16
|
-
end.await
|
17
|
-
end.await
|
20
|
+
sleep 5
|
18
21
|
rescue ::Interrupt => e
|
19
22
|
o.puts "3-interrupt"
|
20
23
|
ensure
|
data/test/test_socket.rb
CHANGED
@@ -32,3 +32,20 @@ class SocketTest < MiniTest::Test
|
|
32
32
|
server&.close
|
33
33
|
end
|
34
34
|
end
|
35
|
+
|
36
|
+
class HTTPClientTest < MiniTest::Test
|
37
|
+
require 'httparty'
|
38
|
+
require 'json'
|
39
|
+
|
40
|
+
def test_http
|
41
|
+
res = HTTParty.get('http://worldtimeapi.org/api/timezone/Europe/Paris')
|
42
|
+
response = JSON.load(res.body)
|
43
|
+
assert_equal "CEST", response['abbreviation']
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_https
|
47
|
+
res = HTTParty.get('https://worldtimeapi.org/api/timezone/Europe/Paris')
|
48
|
+
response = JSON.load(res.body)
|
49
|
+
assert_equal "CEST", response['abbreviation']
|
50
|
+
end
|
51
|
+
end
|
data/test/test_sync.rb
CHANGED
@@ -20,6 +20,27 @@ class MutexTest < MiniTest::Test
|
|
20
20
|
assert_equal ['>> 1', '<< 1', '>> 2', '<< 2', '>> 3', '<< 3'], buf
|
21
21
|
end
|
22
22
|
|
23
|
+
def test_mutex_race_condition
|
24
|
+
lock = Polyphony::Mutex.new
|
25
|
+
buf = []
|
26
|
+
f1 = spin do
|
27
|
+
lock.synchronize { buf << 1; snooze; lock.synchronize { buf << 1.1 }; snooze }
|
28
|
+
end
|
29
|
+
f2 = spin do
|
30
|
+
lock.synchronize { buf << 2 }
|
31
|
+
end
|
32
|
+
f3 = spin do
|
33
|
+
lock.synchronize { buf << 3 }
|
34
|
+
end
|
35
|
+
|
36
|
+
snooze
|
37
|
+
f2.terminate
|
38
|
+
|
39
|
+
f3.await
|
40
|
+
|
41
|
+
assert_equal [1, 1.1, 3], buf
|
42
|
+
end
|
43
|
+
|
23
44
|
def test_condition_variable
|
24
45
|
buf = []
|
25
46
|
lock1 = Polyphony::Mutex.new
|
data/test/test_throttler.rb
CHANGED
@@ -10,9 +10,7 @@ class ThrottlerTest < MiniTest::Test
|
|
10
10
|
f = spin { loop { t.process { buffer << 1 } } }
|
11
11
|
sleep 0.2
|
12
12
|
f.stop
|
13
|
-
|
14
|
-
expected = (elapsed * 10).to_i
|
15
|
-
assert buffer.size >= expected - 1 && buffer.size <= expected + 1
|
13
|
+
assert_in_range 1..3, buffer.size
|
16
14
|
ensure
|
17
15
|
t.stop
|
18
16
|
end
|
@@ -25,7 +23,7 @@ class ThrottlerTest < MiniTest::Test
|
|
25
23
|
end
|
26
24
|
sleep 0.25
|
27
25
|
f.stop
|
28
|
-
|
26
|
+
assert_in_range 2..6, buffer.size
|
29
27
|
ensure
|
30
28
|
t.stop
|
31
29
|
end
|
@@ -36,8 +34,7 @@ class ThrottlerTest < MiniTest::Test
|
|
36
34
|
f = spin { loop { t.process { buffer << 1 } } }
|
37
35
|
sleep 0.02
|
38
36
|
f.stop
|
39
|
-
|
40
|
-
assert buffer.size <= 3
|
37
|
+
assert_in_range 2..3, buffer.size
|
41
38
|
ensure
|
42
39
|
t.stop
|
43
40
|
end
|
data/test/test_trace.rb
CHANGED
@@ -35,7 +35,9 @@ class TraceTest < MiniTest::Test
|
|
35
35
|
def test_2_fiber_trace
|
36
36
|
records = []
|
37
37
|
thread = Thread.current
|
38
|
-
t = Polyphony::Trace.new(:fiber_all)
|
38
|
+
t = Polyphony::Trace.new(:fiber_all) do |r|
|
39
|
+
records << r if Thread.current == thread && r[:event] =~ /^fiber_/
|
40
|
+
end
|
39
41
|
t.enable
|
40
42
|
Polyphony.trace(true)
|
41
43
|
|
@@ -50,15 +52,15 @@ class TraceTest < MiniTest::Test
|
|
50
52
|
[:current, :fiber_switchpoint],
|
51
53
|
[:f, :fiber_run],
|
52
54
|
[:f, :fiber_switchpoint],
|
53
|
-
[:f, :
|
55
|
+
[:f, :fiber_event_poll_enter],
|
54
56
|
[:f, :fiber_schedule],
|
55
|
-
[:f, :
|
57
|
+
[:f, :fiber_event_poll_leave],
|
56
58
|
[:f, :fiber_run],
|
57
59
|
[:f, :fiber_terminate],
|
58
60
|
[:current, :fiber_switchpoint],
|
59
|
-
[:current, :
|
61
|
+
[:current, :fiber_event_poll_enter],
|
60
62
|
[:current, :fiber_schedule],
|
61
|
-
[:current, :
|
63
|
+
[:current, :fiber_event_poll_leave],
|
62
64
|
[:current, :fiber_run]
|
63
65
|
], events
|
64
66
|
ensure
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polyphony
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.46.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.1.1
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,6 +198,20 @@ dependencies:
|
|
198
198
|
- - '='
|
199
199
|
- !ruby/object:Gem::Version
|
200
200
|
version: 5.34.0
|
201
|
+
- !ruby/object:Gem::Dependency
|
202
|
+
name: httparty
|
203
|
+
requirement: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - '='
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: 0.17.1
|
208
|
+
type: :development
|
209
|
+
prerelease: false
|
210
|
+
version_requirements: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - '='
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: 0.17.1
|
201
215
|
- !ruby/object:Gem::Dependency
|
202
216
|
name: jekyll
|
203
217
|
requirement: !ruby/object:Gem::Requirement
|
@@ -264,6 +278,7 @@ extra_rdoc_files:
|
|
264
278
|
files:
|
265
279
|
- ".github/workflows/test.yml"
|
266
280
|
- ".gitignore"
|
281
|
+
- ".gitmodules"
|
267
282
|
- ".rubocop.yml"
|
268
283
|
- ".vscode/launch.json"
|
269
284
|
- CHANGELOG.md
|
@@ -317,7 +332,6 @@ files:
|
|
317
332
|
- docs/main-concepts/fiber-scheduling.md
|
318
333
|
- docs/main-concepts/index.md
|
319
334
|
- docs/polyphony-logo.png
|
320
|
-
- examples/adapters/concurrent-ruby.rb
|
321
335
|
- examples/adapters/pg_client.rb
|
322
336
|
- examples/adapters/pg_notify.rb
|
323
337
|
- examples/adapters/pg_pool.rb
|
@@ -329,70 +343,48 @@ files:
|
|
329
343
|
- examples/adapters/redis_pubsub_perf.rb
|
330
344
|
- examples/adapters/sequel_mysql.rb
|
331
345
|
- examples/adapters/sequel_mysql_pool.rb
|
332
|
-
- examples/
|
333
|
-
- examples/core/
|
334
|
-
- examples/core/
|
335
|
-
- examples/core/
|
336
|
-
- examples/core/
|
337
|
-
- examples/core/
|
338
|
-
- examples/core/
|
339
|
-
- examples/core/
|
340
|
-
- examples/core/
|
341
|
-
- examples/core/
|
342
|
-
- examples/core/
|
343
|
-
- examples/core/
|
344
|
-
- examples/core/
|
345
|
-
- examples/core/
|
346
|
-
- examples/core/
|
347
|
-
- examples/core/
|
348
|
-
- examples/core/
|
349
|
-
- examples/core/
|
350
|
-
- examples/core/
|
351
|
-
- examples/core/
|
352
|
-
- examples/core/
|
353
|
-
- examples/
|
354
|
-
- examples/
|
355
|
-
- examples/
|
356
|
-
- examples/
|
357
|
-
- examples/
|
358
|
-
- examples/
|
359
|
-
- examples/
|
360
|
-
- examples/
|
361
|
-
- examples/
|
362
|
-
- examples/
|
363
|
-
- examples/
|
364
|
-
- examples/
|
365
|
-
- examples/
|
366
|
-
- examples/
|
367
|
-
- examples/
|
368
|
-
- examples/
|
369
|
-
- examples/
|
370
|
-
- examples/
|
371
|
-
- examples/
|
372
|
-
- examples/core/xx-timer-gc.rb
|
373
|
-
- examples/core/xx-trace.rb
|
374
|
-
- examples/core/xx-using-a-mutex.rb
|
375
|
-
- examples/core/xx-worker-thread.rb
|
346
|
+
- examples/adapters/sequel_pg.rb
|
347
|
+
- examples/core/await.rb
|
348
|
+
- examples/core/channels.rb
|
349
|
+
- examples/core/deferring-an-operation.rb
|
350
|
+
- examples/core/erlang-style-genserver.rb
|
351
|
+
- examples/core/forking.rb
|
352
|
+
- examples/core/handling-signals.rb
|
353
|
+
- examples/core/interrupt.rb
|
354
|
+
- examples/core/pingpong.rb
|
355
|
+
- examples/core/recurrent-timer.rb
|
356
|
+
- examples/core/resource_delegate.rb
|
357
|
+
- examples/core/spin.rb
|
358
|
+
- examples/core/spin_error_backtrace.rb
|
359
|
+
- examples/core/supervise-process.rb
|
360
|
+
- examples/core/supervisor.rb
|
361
|
+
- examples/core/thread-sleep.rb
|
362
|
+
- examples/core/thread_pool.rb
|
363
|
+
- examples/core/throttling.rb
|
364
|
+
- examples/core/timeout.rb
|
365
|
+
- examples/core/using-a-mutex.rb
|
366
|
+
- examples/core/worker-thread.rb
|
367
|
+
- examples/io/backticks.rb
|
368
|
+
- examples/io/echo_client.rb
|
369
|
+
- examples/io/echo_client_from_stdin.rb
|
370
|
+
- examples/io/echo_pipe.rb
|
371
|
+
- examples/io/echo_server.rb
|
372
|
+
- examples/io/echo_server_with_timeout.rb
|
373
|
+
- examples/io/echo_stdin.rb
|
374
|
+
- examples/io/happy-eyeballs.rb
|
375
|
+
- examples/io/httparty.rb
|
376
|
+
- examples/io/irb.rb
|
377
|
+
- examples/io/net-http.rb
|
378
|
+
- examples/io/open.rb
|
379
|
+
- examples/io/pry.rb
|
380
|
+
- examples/io/rack_server.rb
|
381
|
+
- examples/io/raw.rb
|
382
|
+
- examples/io/reline.rb
|
383
|
+
- examples/io/system.rb
|
384
|
+
- examples/io/tcpserver.rb
|
385
|
+
- examples/io/tcpsocket.rb
|
376
386
|
- examples/io/tunnel.rb
|
377
|
-
- examples/io/
|
378
|
-
- examples/io/xx-echo_client.rb
|
379
|
-
- examples/io/xx-echo_client_from_stdin.rb
|
380
|
-
- examples/io/xx-echo_pipe.rb
|
381
|
-
- examples/io/xx-echo_server.rb
|
382
|
-
- examples/io/xx-echo_server_with_timeout.rb
|
383
|
-
- examples/io/xx-echo_stdin.rb
|
384
|
-
- examples/io/xx-happy-eyeballs.rb
|
385
|
-
- examples/io/xx-httparty.rb
|
386
|
-
- examples/io/xx-irb.rb
|
387
|
-
- examples/io/xx-net-http.rb
|
388
|
-
- examples/io/xx-open.rb
|
389
|
-
- examples/io/xx-pry.rb
|
390
|
-
- examples/io/xx-rack_server.rb
|
391
|
-
- examples/io/xx-switch.rb
|
392
|
-
- examples/io/xx-system.rb
|
393
|
-
- examples/io/xx-tcpserver.rb
|
394
|
-
- examples/io/xx-tcpsocket.rb
|
395
|
-
- examples/io/xx-zip.rb
|
387
|
+
- examples/io/zip.rb
|
396
388
|
- examples/performance/fiber_transfer.rb
|
397
389
|
- examples/performance/fs_read.rb
|
398
390
|
- examples/performance/mem-usage.rb
|
@@ -400,17 +392,14 @@ files:
|
|
400
392
|
- examples/performance/multi_snooze.rb
|
401
393
|
- examples/performance/snooze.rb
|
402
394
|
- examples/performance/snooze_raw.rb
|
395
|
+
- examples/performance/switch.rb
|
396
|
+
- examples/performance/thread-vs-fiber/httparty_multi.rb
|
397
|
+
- examples/performance/thread-vs-fiber/httparty_threaded.rb
|
403
398
|
- examples/performance/thread-vs-fiber/polyphony_mt_server.rb
|
404
399
|
- examples/performance/thread-vs-fiber/polyphony_server.rb
|
405
400
|
- examples/performance/thread-vs-fiber/polyphony_server_read_loop.rb
|
406
401
|
- examples/performance/thread-vs-fiber/threaded_server.rb
|
407
|
-
- examples/performance/thread-vs-fiber/xx-httparty_multi.rb
|
408
|
-
- examples/performance/thread-vs-fiber/xx-httparty_threaded.rb
|
409
402
|
- examples/performance/thread_pool_perf.rb
|
410
|
-
- examples/performance/xx-array.rb
|
411
|
-
- examples/performance/xx-fiber-switch.rb
|
412
|
-
- examples/performance/xx-snooze.rb
|
413
|
-
- examples/xx-spin.rb
|
414
403
|
- ext/libev/Changes
|
415
404
|
- ext/libev/LICENSE
|
416
405
|
- ext/libev/README
|
@@ -427,19 +416,38 @@ files:
|
|
427
416
|
- ext/libev/ev_win32.c
|
428
417
|
- ext/libev/ev_wrap.h
|
429
418
|
- ext/libev/test_libev_win32.c
|
419
|
+
- ext/liburing/liburing.h
|
420
|
+
- ext/liburing/liburing/README.md
|
421
|
+
- ext/liburing/liburing/barrier.h
|
422
|
+
- ext/liburing/liburing/compat.h
|
423
|
+
- ext/liburing/liburing/io_uring.h
|
424
|
+
- ext/liburing/queue.c
|
425
|
+
- ext/liburing/register.c
|
426
|
+
- ext/liburing/setup.c
|
427
|
+
- ext/liburing/syscall.c
|
428
|
+
- ext/liburing/syscall.h
|
430
429
|
- ext/polyphony/backend.h
|
430
|
+
- ext/polyphony/backend_common.h
|
431
|
+
- ext/polyphony/backend_io_uring.c
|
432
|
+
- ext/polyphony/backend_io_uring_context.c
|
433
|
+
- ext/polyphony/backend_io_uring_context.h
|
434
|
+
- ext/polyphony/backend_libev.c
|
431
435
|
- ext/polyphony/event.c
|
432
436
|
- ext/polyphony/extconf.rb
|
433
437
|
- ext/polyphony/fiber.c
|
434
438
|
- ext/polyphony/libev.c
|
435
439
|
- ext/polyphony/libev.h
|
436
|
-
- ext/polyphony/
|
440
|
+
- ext/polyphony/liburing.c
|
441
|
+
- ext/polyphony/playground.c
|
437
442
|
- ext/polyphony/polyphony.c
|
438
443
|
- ext/polyphony/polyphony.h
|
439
444
|
- ext/polyphony/polyphony_ext.c
|
440
445
|
- ext/polyphony/queue.c
|
441
446
|
- ext/polyphony/ring_buffer.c
|
442
447
|
- ext/polyphony/ring_buffer.h
|
448
|
+
- ext/polyphony/runqueue.c
|
449
|
+
- ext/polyphony/runqueue_ring_buffer.c
|
450
|
+
- ext/polyphony/runqueue_ring_buffer.h
|
443
451
|
- ext/polyphony/thread.c
|
444
452
|
- ext/polyphony/tracing.c
|
445
453
|
- lib/polyphony.rb
|
@@ -460,6 +468,7 @@ files:
|
|
460
468
|
- lib/polyphony/core/thread_pool.rb
|
461
469
|
- lib/polyphony/core/throttler.rb
|
462
470
|
- lib/polyphony/extensions/core.rb
|
471
|
+
- lib/polyphony/extensions/debug.rb
|
463
472
|
- lib/polyphony/extensions/fiber.rb
|
464
473
|
- lib/polyphony/extensions/io.rb
|
465
474
|
- lib/polyphony/extensions/openssl.rb
|
@@ -471,6 +480,7 @@ files:
|
|
471
480
|
- test/coverage.rb
|
472
481
|
- test/eg.rb
|
473
482
|
- test/helper.rb
|
483
|
+
- test/io_uring_test.rb
|
474
484
|
- test/q.rb
|
475
485
|
- test/run.rb
|
476
486
|
- test/stress.rb
|
@@ -519,7 +529,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
519
529
|
- !ruby/object:Gem::Version
|
520
530
|
version: '0'
|
521
531
|
requirements: []
|
522
|
-
rubygems_version: 3.1.
|
532
|
+
rubygems_version: 3.1.4
|
523
533
|
signing_key:
|
524
534
|
specification_version: 4
|
525
535
|
summary: Fine grained concurrency for Ruby
|