require 'test/unit' require 'soap/mapping' module SOAP class TestMapping < Test::Unit::TestCase def test_date targets = [ ["2002-12-31", "2002-12-31Z"], ["2002-12-31+00:00", "2002-12-31Z"], ["2002-12-31-00:00", "2002-12-31Z"], ["-2002-12-31", "-2002-12-31Z"], ["-2002-12-31+00:00", "-2002-12-31Z"], ["-2002-12-31-00:00", "-2002-12-31Z"], ] targets.each do |str, expectec| d = Date.parse(str) assert_equal(d.class, convert(d).class) assert_equal(d, convert(d)) end end def test_datetime targets = [ ["2002-12-31T23:59:59.00", "2002-12-31T23:59:59Z"], ["2002-12-31T23:59:59+00:00", "2002-12-31T23:59:59Z"], ["2002-12-31T23:59:59-00:00", "2002-12-31T23:59:59Z"], ["-2002-12-31T23:59:59.00", "-2002-12-31T23:59:59Z"], ["-2002-12-31T23:59:59+00:00", "-2002-12-31T23:59:59Z"], ["-2002-12-31T23:59:59-00:00", "-2002-12-31T23:59:59Z"], ] targets.each do |str, expectec| d = DateTime.parse(str) assert_equal(d.class, convert(d).class) assert_equal(d, convert(d)) end end def convert(obj) SOAP::Mapping.soap2obj(SOAP::Mapping.obj2soap(obj)) end end end '>ruby_2_0_0 The Ruby Programming Language
summaryrefslogtreecommitdiff
path: root/thread_win32.c
AgeCommit message (Collapse)Author
2023-10-13fix `native_thread_destroy()` timingKoichi Sasada
With M:N thread scheduler, the native thread (NT) related resources should be freed when the NT is no longer needed. So the calling `native_thread_destroy()` at the end of `is will be freed when `thread_cleanup_func()` (at the end of Ruby thread) is not correct timing. Call it when the corresponding Ruby thread is collected.
2023-10-12M:N thread scheduler for RactorsKoichi Sasada
This patch introduce M:N thread scheduler for Ractor system. In general, M:N thread scheduler employs N native threads (OS threads) to manage M user-level threads (Ruby threads in this case). On the Ruby interpreter, 1 native thread is provided for 1 Ractor and all Ruby threads are managed by the native thread. From Ruby 1.9, the interpreter uses 1:1 thread scheduler which means 1 Ruby thread has 1 native thread. M:N scheduler change this strategy. Because of compatibility issue (and stableness issue of the implementation) main Ractor doesn't use M:N scheduler on default. On the other words, threads on the main Ractor will be managed with 1:1 thread scheduler. There are additional settings by environment variables: `RUBY_MN_THREADS=1` enables M:N thread scheduler on the main ractor. Note that non-main ractors use the M:N scheduler without this configuration. With this configuration, single ractor applications run threads on M:1 thread scheduler (green threads, user-level threads). `RUBY_MAX_CPU=n` specifies maximum number of native threads for M:N scheduler (default: 8). This patch will be reverted soon if non-easy issues are found. [Bug #19842]
2023-06-30Compile disabled code for thread cache alwaysNobuyoshi Nakada
2023-03-31pass `th` to `thread_sched_to_waiting()`Koichi Sasada
for future extension Notes: Merged: https://github.com/ruby/ruby/pull/7639
2023-03-15Remove SIGCHLD `waidpid`. (#7527)Samuel Williams
* Remove `waitpid_lock` and related code. * Remove un-necessary test. * Remove `rb_thread_sleep_interruptible` dead code. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-03-14Revert SIGCHLD changes to diagnose CI failures. (#7517)Samuel Williams
* Revert "Remove special handling of `SIGCHLD`. (#7482)" This reverts commit 44a0711eab7fbc71ac2c8ff489d8c53e97a8fe75. * Revert "Remove prototypes for functions that are no longer used. (#7497)" This reverts commit 4dce12bead3bfd91fd80b5e7195f7f540ffffacb. * Revert "Remove SIGCHLD `waidpid`. (#7476)" This reverts commit 1658e7d96696a656d9bd0a0c84c82cde86914ba2. * Fix change to rjit variable name. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-03-09Remove SIGCHLD `waidpid`. (#7476)Samuel Williams
* Remove `waitpid_lock` and related code. * Remove un-necessary test. * Remove `rb_thread_sleep_interruptible` dead code. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-03-06TestThreadInstrumentation: emit the EXIT event soonerJean Boussier
``` 1) Failure: TestThreadInstrumentation#test_thread_instrumentation [/tmp/ruby/src/trunk-repeat20-asserts/test/-ext-/thread/test_instrumentation_api.rb:33]: Call counters[4]: [3, 4, 4, 4, 0]. Expected 0 to be > 0. ``` We fire the EXIT hook after the call to `thread_sched_to_dead` which mean another thread might be running before the `EXIT` hook have been executed. Notes: Merged: https://github.com/ruby/ruby/pull/7249