Commit e408bea
committed
daemon: Fix slow start with Ruby 3
This does not change any specification.
This just changes to use a Ruby thread instead of `CreateThread`.
It is very very fast to use a Ruby thread from the beginning.
Service startup is noticeably slower with Ruby 3.
(Please see #84).
Windows service needs to finish `StartServiceCtrlDispatcher` in
30 seconds by default.
With Ruby 3 or later, this problem can cause timeout errors.
The more CPUs, the slower it tends to be.
Maybe some implementation about threading has changed with Ruby 3 series.
The current implementation switches between multiple Ruby threads and
non-Ruby threads.
This complex process may be unsuitable for Ruby 3.
`CreateThread` makes a non-Ruby thread, and it calls Ruby Proc, and it
makes a Ruby thread, and ...
Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>1 parent 5e0bad6 commit e408bea
2 files changed
+16
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | 189 | | |
209 | 190 | | |
210 | 191 | | |
| |||
254 | 235 | | |
255 | 236 | | |
256 | 237 | | |
257 | | - | |
| 238 | + | |
| 239 | + | |
258 | 240 | | |
259 | | - | |
260 | | - | |
261 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
262 | 244 | | |
263 | | - | |
264 | | - | |
265 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
266 | 248 | | |
267 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
268 | 252 | | |
269 | 253 | | |
270 | | - | |
271 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
272 | 257 | | |
273 | 258 | | |
274 | | - | |
275 | | - | |
276 | | - | |
| 259 | + | |
| 260 | + | |
277 | 261 | | |
278 | 262 | | |
279 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
| |||
0 commit comments