libev_scheduler 0.1 → 0.2
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 +25 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +201 -2
- data/ext/libev/Changes +71 -2
- data/ext/libev/ev.c +625 -201
- data/ext/libev/ev.h +25 -22
- data/ext/libev/ev_epoll.c +16 -14
- data/ext/libev/ev_iouring.c +694 -0
- data/ext/libev/ev_kqueue.c +4 -4
- data/ext/libev/ev_linuxaio.c +78 -100
- data/ext/libev/ev_poll.c +6 -6
- data/ext/libev/ev_port.c +3 -3
- data/ext/libev/ev_select.c +6 -6
- data/ext/libev/ev_vars.h +34 -0
- data/ext/libev/ev_win32.c +2 -2
- data/ext/libev/ev_wrap.h +56 -0
- data/lib/libev_scheduler/version.rb +1 -1
- metadata +4 -3
- data/.github/test.yml +0 -31
data/ext/libev/ev_vars.h
CHANGED
@@ -118,6 +118,35 @@ VARx(int, linuxaio_submitmax)
|
|
118
118
|
VARx(ev_io, linuxaio_epoll_w)
|
119
119
|
#endif
|
120
120
|
|
121
|
+
#if EV_USE_IOURING || EV_GENWRAP
|
122
|
+
VARx(int, iouring_fd)
|
123
|
+
VARx(unsigned, iouring_to_submit);
|
124
|
+
VARx(int, iouring_entries)
|
125
|
+
VARx(int, iouring_max_entries)
|
126
|
+
VARx(void *, iouring_sq_ring)
|
127
|
+
VARx(void *, iouring_cq_ring)
|
128
|
+
VARx(void *, iouring_sqes)
|
129
|
+
VARx(uint32_t, iouring_sq_ring_size)
|
130
|
+
VARx(uint32_t, iouring_cq_ring_size)
|
131
|
+
VARx(uint32_t, iouring_sqes_size)
|
132
|
+
VARx(uint32_t, iouring_sq_head)
|
133
|
+
VARx(uint32_t, iouring_sq_tail)
|
134
|
+
VARx(uint32_t, iouring_sq_ring_mask)
|
135
|
+
VARx(uint32_t, iouring_sq_ring_entries)
|
136
|
+
VARx(uint32_t, iouring_sq_flags)
|
137
|
+
VARx(uint32_t, iouring_sq_dropped)
|
138
|
+
VARx(uint32_t, iouring_sq_array)
|
139
|
+
VARx(uint32_t, iouring_cq_head)
|
140
|
+
VARx(uint32_t, iouring_cq_tail)
|
141
|
+
VARx(uint32_t, iouring_cq_ring_mask)
|
142
|
+
VARx(uint32_t, iouring_cq_ring_entries)
|
143
|
+
VARx(uint32_t, iouring_cq_overflow)
|
144
|
+
VARx(uint32_t, iouring_cq_cqes)
|
145
|
+
VARx(ev_tstamp, iouring_tfd_to)
|
146
|
+
VARx(int, iouring_tfd)
|
147
|
+
VARx(ev_io, iouring_tfd_w)
|
148
|
+
#endif
|
149
|
+
|
121
150
|
#if EV_USE_KQUEUE || EV_GENWRAP
|
122
151
|
VARx(pid_t, kqueue_fd_pid)
|
123
152
|
VARx(struct kevent *, kqueue_changes)
|
@@ -198,6 +227,11 @@ VARx(ev_io, sigfd_w)
|
|
198
227
|
VARx(sigset_t, sigfd_set)
|
199
228
|
#endif
|
200
229
|
|
230
|
+
#if EV_USE_TIMERFD || EV_GENWRAP
|
231
|
+
VARx(int, timerfd) /* timerfd for time jump detection */
|
232
|
+
VARx(ev_io, timerfd_w)
|
233
|
+
#endif
|
234
|
+
|
201
235
|
VARx(unsigned int, origflags) /* original loop flags */
|
202
236
|
|
203
237
|
#if EV_FEATURE_API || EV_GENWRAP
|
data/ext/libev/ev_win32.c
CHANGED
@@ -154,8 +154,8 @@ ev_time (void)
|
|
154
154
|
ui.u.LowPart = ft.dwLowDateTime;
|
155
155
|
ui.u.HighPart = ft.dwHighDateTime;
|
156
156
|
|
157
|
-
/* msvc cannot convert ulonglong to double... yes, it is that sucky */
|
158
|
-
return (LONGLONG)(ui.QuadPart - 116444736000000000) * 1e-
|
157
|
+
/* also, msvc cannot convert ulonglong to double... yes, it is that sucky */
|
158
|
+
return EV_TS_FROM_USEC (((LONGLONG)(ui.QuadPart - 116444736000000000) * 1e-1));
|
159
159
|
}
|
160
160
|
|
161
161
|
#endif
|
data/ext/libev/ev_wrap.h
CHANGED
@@ -44,6 +44,32 @@
|
|
44
44
|
#define invoke_cb ((loop)->invoke_cb)
|
45
45
|
#define io_blocktime ((loop)->io_blocktime)
|
46
46
|
#define iocp ((loop)->iocp)
|
47
|
+
#define iouring_cq_cqes ((loop)->iouring_cq_cqes)
|
48
|
+
#define iouring_cq_head ((loop)->iouring_cq_head)
|
49
|
+
#define iouring_cq_overflow ((loop)->iouring_cq_overflow)
|
50
|
+
#define iouring_cq_ring ((loop)->iouring_cq_ring)
|
51
|
+
#define iouring_cq_ring_entries ((loop)->iouring_cq_ring_entries)
|
52
|
+
#define iouring_cq_ring_mask ((loop)->iouring_cq_ring_mask)
|
53
|
+
#define iouring_cq_ring_size ((loop)->iouring_cq_ring_size)
|
54
|
+
#define iouring_cq_tail ((loop)->iouring_cq_tail)
|
55
|
+
#define iouring_entries ((loop)->iouring_entries)
|
56
|
+
#define iouring_fd ((loop)->iouring_fd)
|
57
|
+
#define iouring_max_entries ((loop)->iouring_max_entries)
|
58
|
+
#define iouring_sq_array ((loop)->iouring_sq_array)
|
59
|
+
#define iouring_sq_dropped ((loop)->iouring_sq_dropped)
|
60
|
+
#define iouring_sq_flags ((loop)->iouring_sq_flags)
|
61
|
+
#define iouring_sq_head ((loop)->iouring_sq_head)
|
62
|
+
#define iouring_sq_ring ((loop)->iouring_sq_ring)
|
63
|
+
#define iouring_sq_ring_entries ((loop)->iouring_sq_ring_entries)
|
64
|
+
#define iouring_sq_ring_mask ((loop)->iouring_sq_ring_mask)
|
65
|
+
#define iouring_sq_ring_size ((loop)->iouring_sq_ring_size)
|
66
|
+
#define iouring_sq_tail ((loop)->iouring_sq_tail)
|
67
|
+
#define iouring_sqes ((loop)->iouring_sqes)
|
68
|
+
#define iouring_sqes_size ((loop)->iouring_sqes_size)
|
69
|
+
#define iouring_tfd ((loop)->iouring_tfd)
|
70
|
+
#define iouring_tfd_to ((loop)->iouring_tfd_to)
|
71
|
+
#define iouring_tfd_w ((loop)->iouring_tfd_w)
|
72
|
+
#define iouring_to_submit ((loop)->iouring_to_submit)
|
47
73
|
#define kqueue_changecnt ((loop)->kqueue_changecnt)
|
48
74
|
#define kqueue_changemax ((loop)->kqueue_changemax)
|
49
75
|
#define kqueue_changes ((loop)->kqueue_changes)
|
@@ -97,6 +123,8 @@
|
|
97
123
|
#define sigfd_w ((loop)->sigfd_w)
|
98
124
|
#define timeout_blocktime ((loop)->timeout_blocktime)
|
99
125
|
#define timercnt ((loop)->timercnt)
|
126
|
+
#define timerfd ((loop)->timerfd)
|
127
|
+
#define timerfd_w ((loop)->timerfd_w)
|
100
128
|
#define timermax ((loop)->timermax)
|
101
129
|
#define timers ((loop)->timers)
|
102
130
|
#define userdata ((loop)->userdata)
|
@@ -151,6 +179,32 @@
|
|
151
179
|
#undef invoke_cb
|
152
180
|
#undef io_blocktime
|
153
181
|
#undef iocp
|
182
|
+
#undef iouring_cq_cqes
|
183
|
+
#undef iouring_cq_head
|
184
|
+
#undef iouring_cq_overflow
|
185
|
+
#undef iouring_cq_ring
|
186
|
+
#undef iouring_cq_ring_entries
|
187
|
+
#undef iouring_cq_ring_mask
|
188
|
+
#undef iouring_cq_ring_size
|
189
|
+
#undef iouring_cq_tail
|
190
|
+
#undef iouring_entries
|
191
|
+
#undef iouring_fd
|
192
|
+
#undef iouring_max_entries
|
193
|
+
#undef iouring_sq_array
|
194
|
+
#undef iouring_sq_dropped
|
195
|
+
#undef iouring_sq_flags
|
196
|
+
#undef iouring_sq_head
|
197
|
+
#undef iouring_sq_ring
|
198
|
+
#undef iouring_sq_ring_entries
|
199
|
+
#undef iouring_sq_ring_mask
|
200
|
+
#undef iouring_sq_ring_size
|
201
|
+
#undef iouring_sq_tail
|
202
|
+
#undef iouring_sqes
|
203
|
+
#undef iouring_sqes_size
|
204
|
+
#undef iouring_tfd
|
205
|
+
#undef iouring_tfd_to
|
206
|
+
#undef iouring_tfd_w
|
207
|
+
#undef iouring_to_submit
|
154
208
|
#undef kqueue_changecnt
|
155
209
|
#undef kqueue_changemax
|
156
210
|
#undef kqueue_changes
|
@@ -204,6 +258,8 @@
|
|
204
258
|
#undef sigfd_w
|
205
259
|
#undef timeout_blocktime
|
206
260
|
#undef timercnt
|
261
|
+
#undef timerfd
|
262
|
+
#undef timerfd_w
|
207
263
|
#undef timermax
|
208
264
|
#undef timers
|
209
265
|
#undef userdata
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libev_scheduler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -60,7 +60,7 @@ extensions:
|
|
60
60
|
extra_rdoc_files:
|
61
61
|
- README.md
|
62
62
|
files:
|
63
|
-
- ".github/test.yml"
|
63
|
+
- ".github/workflows/test.yml"
|
64
64
|
- ".gitignore"
|
65
65
|
- CHANGELOG.md
|
66
66
|
- Gemfile
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- ext/libev/ev.c
|
79
79
|
- ext/libev/ev.h
|
80
80
|
- ext/libev/ev_epoll.c
|
81
|
+
- ext/libev/ev_iouring.c
|
81
82
|
- ext/libev/ev_kqueue.c
|
82
83
|
- ext/libev/ev_linuxaio.c
|
83
84
|
- ext/libev/ev_poll.c
|
data/.github/test.yml
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
name: Tests
|
2
|
-
|
3
|
-
on: [push, pull_request]
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
build:
|
7
|
-
strategy:
|
8
|
-
fail-fast: false
|
9
|
-
matrix:
|
10
|
-
os: [ubuntu-latest]
|
11
|
-
ruby: [3.0]
|
12
|
-
|
13
|
-
name: >-
|
14
|
-
${{matrix.os}}, ${{matrix.ruby}}
|
15
|
-
|
16
|
-
runs-on: ${{matrix.os}}
|
17
|
-
steps:
|
18
|
-
- uses: actions/checkout@v1
|
19
|
-
- uses: actions/setup-ruby@v1
|
20
|
-
with:
|
21
|
-
ruby-version: ${{matrix.ruby}}
|
22
|
-
- name: Install dependencies
|
23
|
-
run: |
|
24
|
-
gem install bundler
|
25
|
-
bundle install
|
26
|
-
- name: Show Linux kernel version
|
27
|
-
run: uname -r
|
28
|
-
- name: Compile C-extension
|
29
|
-
run: bundle exec rake compile
|
30
|
-
- name: Run tests
|
31
|
-
run: bundle exec rake test
|