io-event 1.14.2 → 1.14.3
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
- checksums.yaml.gz.sig +0 -0
- data/ext/io/event/selector/kqueue.c +2 -2
- data/ext/io/event/selector/selector.c +1 -1
- data/ext/io/event/selector/uring.c +13 -3
- data/lib/io/event/debug/selector.rb +6 -0
- data/lib/io/event/selector/select.rb +2 -2
- data/lib/io/event/version.rb +1 -1
- data/readme.md +4 -0
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 153dd5fa3b8e1b61e31f0304ac5b0c3dd274a877899b7569d092865219cd18e8
|
|
4
|
+
data.tar.gz: 5eae7ea5c192e2df1e3c02738dc76a6c3072ad0265eee78b26ee74a17ce43697
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9b85b8d27de9d9319fcba699b6c939670a898210170f842ff7381a8f0446d04c1ca7da3f994265ce77cd2631ee621cbcb6943d39eb386045a169675d87a7d8f3
|
|
7
|
+
data.tar.gz: 3b4482cbe17cef909e01fb1701b30320f46497c97a3a7c77fe1c11da33cfd4eb20353dcc68476b25c147f410e217b42a45c9a1c0ee14e8dca1f54ceaf0051619
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -728,7 +728,7 @@ VALUE io_write_loop(VALUE _arguments) {
|
|
|
728
728
|
break;
|
|
729
729
|
} else if (length > 0 && IO_Event_try_again(errno)) {
|
|
730
730
|
if (DEBUG_IO_WRITE) fprintf(stderr, "IO_Event_Selector_KQueue_io_wait(fd=%d, length=%zu)\n", arguments->descriptor, length);
|
|
731
|
-
IO_Event_Selector_KQueue_io_wait(arguments->self, arguments->fiber, arguments->io, RB_INT2NUM(
|
|
731
|
+
IO_Event_Selector_KQueue_io_wait(arguments->self, arguments->fiber, arguments->io, RB_INT2NUM(IO_EVENT_WRITABLE));
|
|
732
732
|
} else {
|
|
733
733
|
if (DEBUG_IO_WRITE) fprintf(stderr, "io_write_loop(fd=%d, length=%zu) -> errno=%d\n", arguments->descriptor, length, errno);
|
|
734
734
|
return rb_fiber_scheduler_io_result(-1, errno);
|
|
@@ -737,7 +737,7 @@ VALUE io_write_loop(VALUE _arguments) {
|
|
|
737
737
|
maximum_size = size - offset;
|
|
738
738
|
}
|
|
739
739
|
|
|
740
|
-
if (
|
|
740
|
+
if (DEBUG_IO_WRITE) fprintf(stderr, "io_write_loop(fd=%d, length=%zu) -> %zu\n", arguments->descriptor, length, offset);
|
|
741
741
|
return rb_fiber_scheduler_io_result(total, 0);
|
|
742
742
|
};
|
|
743
743
|
|
|
@@ -29,7 +29,7 @@ VALUE IO_Event_Selector_process_status_wait(rb_pid_t pid, int flags)
|
|
|
29
29
|
int IO_Event_Selector_nonblock_set(int file_descriptor)
|
|
30
30
|
{
|
|
31
31
|
#ifdef _WIN32
|
|
32
|
-
rb_w32_set_nonblock(file_descriptor);
|
|
32
|
+
return rb_w32_set_nonblock(file_descriptor);
|
|
33
33
|
#else
|
|
34
34
|
// Get the current mode:
|
|
35
35
|
int flags = fcntl(file_descriptor, F_GETFL, 0);
|
|
@@ -988,6 +988,10 @@ VALUE IO_Event_Selector_URing_io_close(VALUE self, VALUE io) {
|
|
|
988
988
|
io_uring_prep_close(sqe, descriptor);
|
|
989
989
|
io_uring_sqe_set_data(sqe, NULL);
|
|
990
990
|
io_uring_submit_now(selector);
|
|
991
|
+
|
|
992
|
+
// It would be nice to explore not flushing immediately, but instead deferring to the next select cycle.
|
|
993
|
+
// The problem with this approach is that if the user expects the file descriptor to be closed immediately, (e.g. before fork), it may not be closed in time.
|
|
994
|
+
// io_uring_submit_pending(selector);
|
|
991
995
|
} else {
|
|
992
996
|
close(descriptor);
|
|
993
997
|
}
|
|
@@ -1101,13 +1105,19 @@ unsigned select_process_completions(struct IO_Event_Selector_URing *selector) {
|
|
|
1101
1105
|
}
|
|
1102
1106
|
|
|
1103
1107
|
io_uring_cq_advance(ring, 1);
|
|
1104
|
-
// This marks the waiting operation as "complete":
|
|
1105
|
-
IO_Event_Selector_URing_Completion_release(selector, completion);
|
|
1106
1108
|
|
|
1109
|
+
VALUE fiber = 0;
|
|
1107
1110
|
if (waiting && waiting->fiber) {
|
|
1108
1111
|
assert(waiting->result != -ECANCELED);
|
|
1109
1112
|
|
|
1110
|
-
|
|
1113
|
+
fiber = waiting->fiber;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
// This marks the waiting operation as "complete":
|
|
1117
|
+
IO_Event_Selector_URing_Completion_release(selector, completion);
|
|
1118
|
+
|
|
1119
|
+
if (fiber) {
|
|
1120
|
+
IO_Event_Selector_loop_resume(&selector->backend, fiber, 0, NULL);
|
|
1111
1121
|
}
|
|
1112
1122
|
}
|
|
1113
1123
|
|
|
@@ -128,6 +128,12 @@ module IO::Event
|
|
|
128
128
|
@selector.ready?
|
|
129
129
|
end
|
|
130
130
|
|
|
131
|
+
# Run the given blocking operation and wait for its completion.
|
|
132
|
+
def blocking_operation_wait(operation)
|
|
133
|
+
log("Waiting for blocking operation #{operation.inspect}")
|
|
134
|
+
@selector.blocking_operation_wait(operation)
|
|
135
|
+
end
|
|
136
|
+
|
|
131
137
|
# Wait for the given process, forwarded to the underlying selector.
|
|
132
138
|
def process_wait(*arguments)
|
|
133
139
|
log("Waiting for process with #{arguments.inspect}")
|
|
@@ -230,7 +230,7 @@ module IO::Event
|
|
|
230
230
|
|
|
231
231
|
if result < 0
|
|
232
232
|
if length > 0 and again?(result)
|
|
233
|
-
self.io_wait(fiber, io, IO::
|
|
233
|
+
self.io_wait(fiber, io, IO::WRITABLE)
|
|
234
234
|
else
|
|
235
235
|
return result
|
|
236
236
|
end
|
|
@@ -287,7 +287,7 @@ module IO::Event
|
|
|
287
287
|
|
|
288
288
|
if again?(result)
|
|
289
289
|
if length > 0
|
|
290
|
-
self.io_wait(fiber, io, IO::
|
|
290
|
+
self.io_wait(fiber, io, IO::WRITABLE)
|
|
291
291
|
else
|
|
292
292
|
return result
|
|
293
293
|
end
|
data/lib/io/event/version.rb
CHANGED
data/readme.md
CHANGED
|
@@ -18,6 +18,10 @@ Please see the [project documentation](https://socketry.github.io/io-event/) for
|
|
|
18
18
|
|
|
19
19
|
Please see the [project releases](https://socketry.github.io/io-event/releases/index) for all releases.
|
|
20
20
|
|
|
21
|
+
### v1.14.3
|
|
22
|
+
|
|
23
|
+
- Fix several implementation bugs that could cause deadlocks on blocking writes.
|
|
24
|
+
|
|
21
25
|
### v1.14.0
|
|
22
26
|
|
|
23
27
|
- [Enhanced `IO::Event::PriorityHeap` with deletion and bulk insertion methods](https://socketry.github.io/io-event/releases/index#enhanced-io::event::priorityheap-with-deletion-and-bulk-insertion-methods)
|
data/releases.md
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: io-event
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.14.
|
|
4
|
+
version: 1.14.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
117
|
version: '0'
|
|
118
118
|
requirements: []
|
|
119
|
-
rubygems_version:
|
|
119
|
+
rubygems_version: 4.0.3
|
|
120
120
|
specification_version: 4
|
|
121
121
|
summary: An event loop.
|
|
122
122
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|