uringmachine 0.30.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -4
- data/README.md +46 -38
- data/TODO.md +56 -2
- data/benchmark/gets.rb +7 -7
- data/benchmark/gets_concurrent.rb +10 -10
- data/benchmark/http_parse.rb +14 -14
- data/benchmark/http_server_accept_queue.rb +11 -7
- data/benchmark/http_server_multi_accept.rb +7 -7
- data/benchmark/http_server_multi_ractor.rb +7 -7
- data/benchmark/http_server_single_thread.rb +7 -7
- data/benchmark/openssl.rb +50 -22
- data/docs/design/buffer_pool.md +1 -1
- data/examples/fiber_concurrency_io.rb +52 -0
- data/examples/fiber_concurrency_naive.rb +26 -0
- data/examples/fiber_concurrency_runqueue.rb +33 -0
- data/examples/io_uring_simple.c +24 -0
- data/examples/pg.rb +2 -2
- data/examples/stream.rb +2 -2
- data/ext/um/um.c +20 -3
- data/ext/um/um.h +24 -18
- data/ext/um/um_connection.c +775 -0
- data/ext/um/um_connection_class.c +394 -0
- data/ext/um/um_ssl.c +37 -2
- data/ext/um/um_utils.c +1 -1
- data/grant-2025/final-report.md +2 -0
- data/grant-2025/journal.md +1 -1
- data/lib/uringmachine/version.rb +1 -1
- data/lib/uringmachine.rb +16 -16
- data/test/{test_stream.rb → test_connection.rb} +290 -153
- data/test/test_um.rb +18 -18
- metadata +10 -6
- data/ext/um/um_stream.c +0 -706
- data/ext/um/um_stream_class.c +0 -317
data/test/test_um.rb
CHANGED
|
@@ -3506,53 +3506,53 @@ class SetChildSubreaperTest < Minitest::Test
|
|
|
3506
3506
|
end
|
|
3507
3507
|
end
|
|
3508
3508
|
|
|
3509
|
-
class
|
|
3509
|
+
class ConnectionMethodTest < UMBaseTest
|
|
3510
3510
|
def setup
|
|
3511
3511
|
super
|
|
3512
3512
|
@rfd, @wfd = UM.pipe
|
|
3513
3513
|
end
|
|
3514
3514
|
|
|
3515
3515
|
def teardown
|
|
3516
|
-
@
|
|
3516
|
+
@conn = nil
|
|
3517
3517
|
machine.close(@rfd) rescue nil
|
|
3518
3518
|
machine.close(@wfd) rescue nil
|
|
3519
3519
|
super
|
|
3520
3520
|
end
|
|
3521
3521
|
|
|
3522
|
-
def
|
|
3522
|
+
def test_connection_method
|
|
3523
3523
|
machine.write(@wfd, "foobar")
|
|
3524
3524
|
machine.close(@wfd)
|
|
3525
3525
|
|
|
3526
|
-
|
|
3527
|
-
assert_kind_of UM::
|
|
3526
|
+
conn = machine.connection(@rfd)
|
|
3527
|
+
assert_kind_of UM::Connection, conn
|
|
3528
3528
|
|
|
3529
|
-
buf =
|
|
3529
|
+
buf = conn.read(3)
|
|
3530
3530
|
assert_equal 'foo', buf
|
|
3531
3531
|
|
|
3532
|
-
buf =
|
|
3532
|
+
buf = conn.read(-6)
|
|
3533
3533
|
assert_equal 'bar', buf
|
|
3534
|
-
assert
|
|
3534
|
+
assert conn.eof?
|
|
3535
3535
|
|
|
3536
|
-
|
|
3536
|
+
conn.clear
|
|
3537
3537
|
end
|
|
3538
3538
|
|
|
3539
|
-
def
|
|
3539
|
+
def test_connection_method_with_block
|
|
3540
3540
|
machine.write(@wfd, "foobar")
|
|
3541
3541
|
machine.close(@wfd)
|
|
3542
3542
|
|
|
3543
3543
|
bufs = []
|
|
3544
|
-
|
|
3545
|
-
res = machine.
|
|
3546
|
-
|
|
3544
|
+
conn_obj = nil
|
|
3545
|
+
res = machine.connection(@rfd) do |s|
|
|
3546
|
+
conn_obj = s
|
|
3547
3547
|
|
|
3548
|
-
bufs << s.
|
|
3549
|
-
bufs << s.
|
|
3548
|
+
bufs << s.read(3)
|
|
3549
|
+
bufs << s.read(-6)
|
|
3550
3550
|
|
|
3551
3551
|
:foo
|
|
3552
3552
|
end
|
|
3553
3553
|
|
|
3554
|
-
assert_kind_of UM::
|
|
3555
|
-
assert
|
|
3554
|
+
assert_kind_of UM::Connection, conn_obj
|
|
3555
|
+
assert conn_obj.eof?
|
|
3556
3556
|
assert_equal ['foo', 'bar'], bufs
|
|
3557
3557
|
assert_equal :foo, res
|
|
3558
3558
|
end
|
|
@@ -3688,7 +3688,7 @@ class TeeTest < UMBaseTest
|
|
|
3688
3688
|
assert_equal 6, len1
|
|
3689
3689
|
|
|
3690
3690
|
assert_equal 'foobar', result2
|
|
3691
|
-
assert_equal 6, len2
|
|
3691
|
+
assert_equal 6, len2
|
|
3692
3692
|
ensure
|
|
3693
3693
|
machine.terminate(f)
|
|
3694
3694
|
machine.join(f)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: uringmachine
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.31.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sharon Rosner
|
|
@@ -26,6 +26,8 @@ extra_rdoc_files:
|
|
|
26
26
|
- ext/um/um_async_op_class.c
|
|
27
27
|
- ext/um/um_buffer_pool.c
|
|
28
28
|
- ext/um/um_class.c
|
|
29
|
+
- ext/um/um_connection.c
|
|
30
|
+
- ext/um/um_connection_class.c
|
|
29
31
|
- ext/um/um_const.c
|
|
30
32
|
- ext/um/um_ext.c
|
|
31
33
|
- ext/um/um_mutex_class.c
|
|
@@ -33,8 +35,6 @@ extra_rdoc_files:
|
|
|
33
35
|
- ext/um/um_queue_class.c
|
|
34
36
|
- ext/um/um_sidecar.c
|
|
35
37
|
- ext/um/um_ssl.c
|
|
36
|
-
- ext/um/um_stream.c
|
|
37
|
-
- ext/um/um_stream_class.c
|
|
38
38
|
- ext/um/um_sync.c
|
|
39
39
|
- ext/um/um_utils.c
|
|
40
40
|
- lib/uringmachine.rb
|
|
@@ -90,12 +90,16 @@ files:
|
|
|
90
90
|
- docs/um_api.md
|
|
91
91
|
- docs/wroclove.rb.md
|
|
92
92
|
- examples/echo_server.rb
|
|
93
|
+
- examples/fiber_concurrency_io.rb
|
|
94
|
+
- examples/fiber_concurrency_naive.rb
|
|
95
|
+
- examples/fiber_concurrency_runqueue.rb
|
|
93
96
|
- examples/fiber_scheduler_demo.rb
|
|
94
97
|
- examples/fiber_scheduler_file_io.rb
|
|
95
98
|
- examples/fiber_scheduler_file_io_async.rb
|
|
96
99
|
- examples/fiber_scheduler_fork.rb
|
|
97
100
|
- examples/http_server.rb
|
|
98
101
|
- examples/inout.rb
|
|
102
|
+
- examples/io_uring_simple.c
|
|
99
103
|
- examples/nc.rb
|
|
100
104
|
- examples/nc_ssl.rb
|
|
101
105
|
- examples/pg.rb
|
|
@@ -110,6 +114,8 @@ files:
|
|
|
110
114
|
- ext/um/um_async_op_class.c
|
|
111
115
|
- ext/um/um_buffer_pool.c
|
|
112
116
|
- ext/um/um_class.c
|
|
117
|
+
- ext/um/um_connection.c
|
|
118
|
+
- ext/um/um_connection_class.c
|
|
113
119
|
- ext/um/um_const.c
|
|
114
120
|
- ext/um/um_ext.c
|
|
115
121
|
- ext/um/um_mutex_class.c
|
|
@@ -117,8 +123,6 @@ files:
|
|
|
117
123
|
- ext/um/um_queue_class.c
|
|
118
124
|
- ext/um/um_sidecar.c
|
|
119
125
|
- ext/um/um_ssl.c
|
|
120
|
-
- ext/um/um_stream.c
|
|
121
|
-
- ext/um/um_stream_class.c
|
|
122
126
|
- ext/um/um_sync.c
|
|
123
127
|
- ext/um/um_utils.c
|
|
124
128
|
- grant-2025/final-report.md
|
|
@@ -135,10 +139,10 @@ files:
|
|
|
135
139
|
- test/run.rb
|
|
136
140
|
- test/test_actor.rb
|
|
137
141
|
- test/test_async_op.rb
|
|
142
|
+
- test/test_connection.rb
|
|
138
143
|
- test/test_fiber.rb
|
|
139
144
|
- test/test_fiber_scheduler.rb
|
|
140
145
|
- test/test_ssl.rb
|
|
141
|
-
- test/test_stream.rb
|
|
142
146
|
- test/test_um.rb
|
|
143
147
|
- uringmachine.gemspec
|
|
144
148
|
- vendor/liburing/.github/actions/codespell/stopwords
|