polyphony 0.61 → 0.62
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 +4 -0
- data/Gemfile.lock +1 -1
- data/ext/polyphony/backend_common.c +26 -21
- data/ext/polyphony/backend_common.h +1 -0
- data/ext/polyphony/runqueue.c +4 -0
- data/ext/polyphony/runqueue.h +1 -0
- data/lib/polyphony/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cea172818871812ebbafcbee0a4b98d130a351f904d7732a02400ef363eac62
|
4
|
+
data.tar.gz: f4ef85515436a463d3732f04bbef457426f267fac01f5c5c28619e42334cd745
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 489b813f1bb2d7d97f87a60024b0665761571c4227e4fab6c733dcdb62b6ee98760473202c9154eb39a4b544663f759e4da6e70603d483e9f2ec2a64363cd4e1
|
7
|
+
data.tar.gz: 05b232d7d67120e0983e60855c928beac6e91271fafc87586da7cc7543128fe326be04d126154ac7e0b0c0b249bf41ca90ab902f79f4a5fbf00cad498061f7e7
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -112,22 +112,6 @@ inline void backend_trace(struct Backend_base *base, int argc, VALUE *argv) {
|
|
112
112
|
rb_funcallv(base->trace_proc, ID_call, argc, argv);
|
113
113
|
}
|
114
114
|
|
115
|
-
inline struct backend_stats backend_base_stats(struct Backend_base *base) {
|
116
|
-
struct backend_stats stats = {
|
117
|
-
.runqueue_length = runqueue_len(&base->runqueue),
|
118
|
-
.runqueue_max_length = runqueue_max_len(&base->runqueue),
|
119
|
-
.op_count = base->op_count,
|
120
|
-
.switch_count = base->switch_count,
|
121
|
-
.poll_count = base->poll_count,
|
122
|
-
.pending_ops = base->pending_count
|
123
|
-
};
|
124
|
-
|
125
|
-
base->op_count = 0;
|
126
|
-
base->switch_count = 0;
|
127
|
-
base->poll_count = 0;
|
128
|
-
return stats;
|
129
|
-
}
|
130
|
-
|
131
115
|
#ifdef POLYPHONY_USE_PIDFD_OPEN
|
132
116
|
#ifndef __NR_pidfd_open
|
133
117
|
#define __NR_pidfd_open 434 /* System call # on most architectures */
|
@@ -312,6 +296,24 @@ inline void backend_run_idle_tasks(struct Backend_base *base) {
|
|
312
296
|
rb_gc_disable();
|
313
297
|
}
|
314
298
|
|
299
|
+
inline struct backend_stats backend_base_stats(struct Backend_base *base) {
|
300
|
+
struct backend_stats stats = {
|
301
|
+
.runqueue_size = runqueue_size(&base->runqueue),
|
302
|
+
.runqueue_length = runqueue_len(&base->runqueue),
|
303
|
+
.runqueue_max_length = runqueue_max_len(&base->runqueue),
|
304
|
+
.op_count = base->op_count,
|
305
|
+
.switch_count = base->switch_count,
|
306
|
+
.poll_count = base->poll_count,
|
307
|
+
.pending_ops = base->pending_count
|
308
|
+
};
|
309
|
+
|
310
|
+
base->op_count = 0;
|
311
|
+
base->switch_count = 0;
|
312
|
+
base->poll_count = 0;
|
313
|
+
return stats;
|
314
|
+
}
|
315
|
+
|
316
|
+
VALUE SYM_runqueue_size;
|
315
317
|
VALUE SYM_runqueue_length;
|
316
318
|
VALUE SYM_runqueue_max_length;
|
317
319
|
VALUE SYM_op_count;
|
@@ -323,6 +325,7 @@ VALUE Backend_stats(VALUE self) {
|
|
323
325
|
struct backend_stats backend_stats = backend_get_stats(self);
|
324
326
|
|
325
327
|
VALUE stats = rb_hash_new();
|
328
|
+
rb_hash_aset(stats, SYM_runqueue_size, INT2NUM(backend_stats.runqueue_size));
|
326
329
|
rb_hash_aset(stats, SYM_runqueue_length, INT2NUM(backend_stats.runqueue_length));
|
327
330
|
rb_hash_aset(stats, SYM_runqueue_max_length, INT2NUM(backend_stats.runqueue_max_length));
|
328
331
|
rb_hash_aset(stats, SYM_op_count, INT2NUM(backend_stats.op_count));
|
@@ -334,13 +337,15 @@ VALUE Backend_stats(VALUE self) {
|
|
334
337
|
}
|
335
338
|
|
336
339
|
void backend_setup_stats_symbols() {
|
337
|
-
|
340
|
+
SYM_runqueue_size = ID2SYM(rb_intern("runqueue_size"));
|
341
|
+
SYM_runqueue_length = ID2SYM(rb_intern("runqueue_length"));
|
338
342
|
SYM_runqueue_max_length = ID2SYM(rb_intern("runqueue_max_length"));
|
339
|
-
SYM_op_count
|
340
|
-
SYM_switch_count
|
341
|
-
SYM_poll_count
|
342
|
-
SYM_pending_ops
|
343
|
+
SYM_op_count = ID2SYM(rb_intern("op_count"));
|
344
|
+
SYM_switch_count = ID2SYM(rb_intern("switch_count"));
|
345
|
+
SYM_poll_count = ID2SYM(rb_intern("poll_count"));
|
346
|
+
SYM_pending_ops = ID2SYM(rb_intern("pending_ops"));
|
343
347
|
|
348
|
+
rb_global_variable(&SYM_runqueue_size);
|
344
349
|
rb_global_variable(&SYM_runqueue_length);
|
345
350
|
rb_global_variable(&SYM_runqueue_max_length);
|
346
351
|
rb_global_variable(&SYM_op_count);
|
data/ext/polyphony/runqueue.c
CHANGED
@@ -44,6 +44,10 @@ inline void runqueue_clear(runqueue_t *runqueue) {
|
|
44
44
|
runqueue_ring_buffer_clear(&runqueue->entries);
|
45
45
|
}
|
46
46
|
|
47
|
+
inline long runqueue_size(runqueue_t *runqueue) {
|
48
|
+
return runqueue->entries.size;
|
49
|
+
}
|
50
|
+
|
47
51
|
inline long runqueue_len(runqueue_t *runqueue) {
|
48
52
|
return runqueue->entries.count;
|
49
53
|
}
|
data/ext/polyphony/runqueue.h
CHANGED
@@ -19,6 +19,7 @@ runqueue_entry runqueue_shift(runqueue_t *runqueue);
|
|
19
19
|
void runqueue_delete(runqueue_t *runqueue, VALUE fiber);
|
20
20
|
int runqueue_index_of(runqueue_t *runqueue, VALUE fiber);
|
21
21
|
void runqueue_clear(runqueue_t *runqueue);
|
22
|
+
long runqueue_size(runqueue_t *runqueue);
|
22
23
|
long runqueue_len(runqueue_t *runqueue);
|
23
24
|
long runqueue_max_len(runqueue_t *runqueue);
|
24
25
|
int runqueue_empty_p(runqueue_t *runqueue);
|
data/lib/polyphony/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polyphony
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.62'
|
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-07-
|
11
|
+
date: 2021-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|