io-event 1.11.0 → 1.11.1
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/epoll.c +4 -0
- data/ext/io/event/selector/kqueue.c +4 -0
- data/ext/io/event/selector/uring.c +19 -1
- data/lib/io/event/selector/select.rb +3 -0
- data/lib/io/event/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: 2bfd02bf24ab7275c5ef9062a15c22059d4bb973f25834d10ca3fe6c925c6401
|
4
|
+
data.tar.gz: 9fbcc8fcded8c2898ffd7567a8e27b87e38479edfd9eaf1951b8066cf0f20b5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc3a2254652c5f37a750fd1cdcde09f933b24e252f3e7964bbac3c16299c2d284adb1808fbb25e3ec6fca4483512e71292166b97b567b55b9428488689248397
|
7
|
+
data.tar.gz: a9869ced6a01d93c89c51b371d784d9a31751d986394ff825d3511a8df56cf995cb13f1b93a0318d773a147112a332c45e2d3bbc785077896b07c72122e0996e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -38,6 +38,10 @@ struct IO_Event_Selector_EPoll
|
|
38
38
|
{
|
39
39
|
struct IO_Event_Selector backend;
|
40
40
|
int descriptor;
|
41
|
+
|
42
|
+
// Flag indicating whether the selector is currently blocked in a system call.
|
43
|
+
// Set to 1 when blocked in epoll_wait() without GVL, 0 otherwise.
|
44
|
+
// Used by wakeup() to determine if an interrupt signal is needed.
|
41
45
|
int blocked;
|
42
46
|
|
43
47
|
struct timespec idle_duration;
|
@@ -47,6 +47,10 @@ struct IO_Event_Selector_KQueue
|
|
47
47
|
{
|
48
48
|
struct IO_Event_Selector backend;
|
49
49
|
int descriptor;
|
50
|
+
|
51
|
+
// Flag indicating whether the selector is currently blocked in a system call.
|
52
|
+
// Set to 1 when blocked in kevent() without GVL, 0 otherwise.
|
53
|
+
// Used by wakeup() to determine if an interrupt signal is needed.
|
50
54
|
int blocked;
|
51
55
|
|
52
56
|
struct timespec idle_duration;
|
@@ -30,6 +30,10 @@ struct IO_Event_Selector_URing
|
|
30
30
|
struct IO_Event_Selector backend;
|
31
31
|
struct io_uring ring;
|
32
32
|
size_t pending;
|
33
|
+
|
34
|
+
// Flag indicating whether the selector is currently blocked in a system call.
|
35
|
+
// Set to 1 when blocked in io_uring_wait_cqe_timeout() without GVL, 0 otherwise.
|
36
|
+
// Used by wakeup() to determine if an interrupt signal is needed.
|
33
37
|
int blocked;
|
34
38
|
|
35
39
|
struct timespec idle_duration;
|
@@ -707,6 +711,20 @@ VALUE IO_Event_Selector_URing_io_read(VALUE self, VALUE fiber, VALUE io, VALUE b
|
|
707
711
|
off_t from = io_seekable(descriptor);
|
708
712
|
|
709
713
|
size_t maximum_size = size - offset;
|
714
|
+
|
715
|
+
// Are we performing a non-blocking read?
|
716
|
+
if (!length) {
|
717
|
+
// If the (maximum) length is zero, that indicates we just want to read whatever is available without blocking.
|
718
|
+
// If we schedule this read into the URing, it will block until data is available, rather than returning immediately.
|
719
|
+
int state = IO_Event_Selector_nonblock_set(descriptor);
|
720
|
+
|
721
|
+
int result = read(descriptor, (char*)base+offset, maximum_size);
|
722
|
+
int error = errno;
|
723
|
+
|
724
|
+
IO_Event_Selector_nonblock_restore(descriptor, state);
|
725
|
+
return rb_fiber_scheduler_io_result(result, errno);
|
726
|
+
}
|
727
|
+
|
710
728
|
while (maximum_size) {
|
711
729
|
int result = io_read(selector, fiber, descriptor, (char*)base+offset, maximum_size, from);
|
712
730
|
|
@@ -1093,7 +1111,7 @@ unsigned select_process_completions(struct IO_Event_Selector_URing *selector) {
|
|
1093
1111
|
}
|
1094
1112
|
}
|
1095
1113
|
|
1096
|
-
if (DEBUG && completed > 0) fprintf(stderr, "select_process_completions
|
1114
|
+
if (DEBUG && completed > 0) fprintf(stderr, "select_process_completions: completed=%d\n", completed);
|
1097
1115
|
|
1098
1116
|
return completed;
|
1099
1117
|
}
|
@@ -17,6 +17,9 @@ module IO::Event
|
|
17
17
|
|
18
18
|
@waiting = Hash.new.compare_by_identity
|
19
19
|
|
20
|
+
# Flag indicating whether the selector is currently blocked in a system call.
|
21
|
+
# Set to true when blocked in ::IO.select, false otherwise.
|
22
|
+
# Used by wakeup() to determine if an interrupt signal is needed.
|
20
23
|
@blocked = false
|
21
24
|
|
22
25
|
@ready = Queue.new
|
data/lib/io/event/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|