aboutsummaryrefslogtreecommitdiffstats
path: root/vm_core.h
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-07 08:06:02 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-07 08:06:02 +0000
commit8e76720ce3482378c2fdef3381d0254be17dfdfa (patch)
tree564fe8d3ec46d4eb7daa4a144d1891ae1b513e58 /vm_core.h
parent5cb9cead557b6db07899771c6fab4cdb203f2cf0 (diff)
downloadruby-8e76720ce3482378c2fdef3381d0254be17dfdfa.tar.gz
vm_core.h (rb_thread_t): use 32-bit running_time_us
The current range based current values of: TIME_QUANTUM_USEC=100000 RUBY_THREAD_PRIORITY_MAX=3 RUBY_THREAD_PRIORITY_MIN=-3 Gives a range of 12500..800000, plenty enough for a 32-bit integer. Clamping this also reduces potential implementation bugs between 32-bit and 64-bit platforms. I may consider a further reduction to uint16_t in the future for M:N threading, but some users may want slightly larger time quantums. * vm_core.h (rb_thread_t): use 32-bit running_time_us git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/vm_core.h b/vm_core.h
index c414498270..f379e9ce20 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -816,7 +816,7 @@ typedef struct rb_thread_struct {
#ifdef USE_SIGALTSTACK
void *altstack;
#endif
- unsigned long running_time_us;
+ uint32_t running_time_us; /* 12500..800000 */
VALUE name;
} rb_thread_t;