summaryrefslogtreecommitdiff
path: root/test/ruby/test_fiber.rb
AgeCommit message (Collapse)Author
2014-11-13* test/lib/envutil.rb: Moved from test/ruby/.akr
* test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-04* test/ruby: get rid of warnings.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-14test_fiber.rb: remove corenobu
* test/ruby/test_fiber.rb (TestFiber#invoke_rec): remove core dump files by stack overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13test/ruby: better assertionsnobu
* test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-19* test/ruby/test_fiber.rb: collect garbage fibers immediately.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-18* variable.c, vm_method.c: remove dead code.ktsj
* test/ruby/test_fiber.rb, test/ruby/test_thread.rb: change accordingly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-20test_fiber.rb: longer timeoutnobu
* test/ruby/test_fiber.rb (test_many_fibers): make timeout longer. 10sec is not sufficient. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-19test/ruby: reap zombiesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-30cont.c: fiber local svarnobu
* cont.c (cont_restore_thread): svar should be separate per fibers. [ruby-core:51331] [Bug #7678] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-22Sync output messagenaruse
* sync $stdout to ensure outputting on expected SEGV. this caused failure: http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20130121T230101Z.log.html.gz * check result of invoke_ruby * use assert_operator git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-16Remove commenting out tests introduced by r38478naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-22* cont.c (rb_fiber_start): in case of jump with TAG_FATAL,nagachika
enqueue error into async_errinfo_queue, because you cannot call TH_TAG_JUMP() in this function. [ruby-dev:45218] [Bug #5993] * thread.c (rb_threadptr_execute_interrupts): now INT2FIX(TAG_FATAL) can be popped from async_errinfo_queue. * vm.c (rb_vm_make_jump_tag_but_local_jump): revert r38441. rb_vm_make_jump_tag_but_local_jump() shouldn't return exception in case of state == TAG_FATAL. * test/ruby/test_fiber.rb (test_exit_in_fiber): fix a test to illuminate Thread.exit should terminate current Thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-19* vm.c: support variable VM/Machine stack sizes.ko1
Specified by the following environment variaables: - RUBY_THREAD_VM_STACK_SIZE: vm stack size used at thread creation. default: 128KB (32bit CPU) or 256KB (64bit CPU). - RUBY_THREAD_MACHINE_STACK_SIZE: machine stack size used at thread creation. default: 512KB or 1024KB. - RUBY_FIBER_VM_STACK_SIZE: vm stack size used at fiber creation. default: 64KB or 128KB. - RUBY_FIBER_MACHINE_STACK_SIZE: machine stack size used at fiber creation. default: 256KB or 256KB. This values are specified at launched timing. You can not change these values at running time. Environ variables are only *hints* because: - They are aligned to 4KB. - They have minimum values (depend on OSs). - Machine stack settings are ignored by some OSs. Default values especially fiber stack sizes are increased. This change affect Fiber's behavior: (1) You can run more complex program on a Fiber. (2) You can not make many (thousands) Fibers because of lack of address space (on 32bit CPU). If (2) bothers you, (a) Use 64bit CPU with big memory, or (b) Specify RUBY_FIBER_(VM|MACHINE)_STACK_SIZE correctly. You need to choose correct stack size carefully. These values are completely rely on systems (OS/compiler and so on). * vm_core.h (rb_vm_t::default_params): add to record above settings. * vm.c (RubyVM::DEFAULT_PARAMS): add new constant to see above setting. * thread_pthread.c: support RUBY_THREAD_MACHINE_STACK_SIZE. * cont.c: support RUBY_FIBER_(VM|MACHINE)_STACK_SIZE. * test/ruby/test_fiber.rb: add tests for above. * test/ruby/test_thread.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-19* test/ruby/test_fiber.rb: remove a strange single quote character.ko1
With this character, this script exits by SyntaxError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-18* vm.c (rb_vm_make_jump_tag_but_local_jump): take care of the casenagachika
TAG_JUMP() with TAG_FATAL (ex. rb_fatal()). * test/ruby/test_fiber.rb (test_fatal_in_fiber): add a test for above. * ext/-test-/fatal/extconf.rb, ext/-test-/fatal/rb_fatal.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-15* cont.c (rb_fiber_start): don't enqueue Qnil to async_errinfo_queue.nagachika
rb_vm_make_jump_tag_but_local_jump() could return Qnil (ex. when finished by Thread.exit). [ruby-dev:45218] [Bug #5993] * test/ruby/test_fiber.rb (test_exit_in_fiber): add test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-29Use assert_normal_exit to split processnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-02* eval.c (rb_mod_using): new method Module#using. [experimental]shugo
* eval.c (rb_mod_refine): new method Module#refine. [experimental] * eval.c (f_using): new method Kernel#using. [experimental] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15* cont.c (rb_fiber_reset_root_local_storage): add a new function tonagachika
restore rb_thread_t::local_storage. * cont.c (rb_obj_is_fiber): add a new function to tell finalizer to prevent fibers from destroy. * gc.c (rb_objspace_call_finalizer): don't sweep fibers at finalizing objspace. * internal.h (rb_fiber_reset_root_local_storage, rb_obj_is_fiber): add prototypes. * vm.c (ruby_vm_destruct): reset main thread's local_storage before free main thread. rb_thread_t::local_storage is replaced by fiber's local storage when forked from fiber, and it should be already freed when the fiber was destroyed. * test/ruby/test_fiber.rb (test_fork_from_fiber): add test for fork from fiber. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-20* cont.c (fiber_switch): ignore fiber context switchnaruse
because destination fiber is same as current fiber. With out this, it may segv on FreeBSD 9. patched by Koichi Sasada. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-09* test/ruby/test_fiber.rb: add tests for r33684 (Fiber#resume).ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03* test/ruby/test_fiber.rb (TestFiber#test_no_valid_cfp):ktsj
add a test. Unlike TestThread#test_no_valid_cfp, this test succeeds even if win32ole is required (see r33153). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 * cont.c (cont_init): clear macihne_stack_start/end of saved thread tonagachika
prevent mark machine stack of GC'ed Thread. root Fiber is not initialized by fiber_init(). based on a patch by Serge Balyuk [ruby-core:35891] fixes #4612 * test/ruby/test_fiber.rb (test_gc_root_fiber): add test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-03* cont.c (rb_fiber_resume): raise an "double resume" error when rootmame
fiber is going to be resumed. [ruby-dev:42523] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-09* test/ruby/test_fiber.rb: add ML ref.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-09* cont.c (fiber_switch): raise FiberError when returning to deadmame
fiber. [ruby-dev:40833] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-01* cont.c (cont_capture, fiber_store): reraise transferred error.nobu
* cont.c (fiber_switch): transfers dead fiber error to the previouse or root fiber if the current fiber is dead. [ruby-core:23651] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06* {ext,lib,test}/**/*.rb: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-13* cont.c (rb_fiber_alive_p): fix to return true instead of 1.ko1
[ruby-dev:37991] * test/ruby/test_fiber.rb: add a test for Fiber#alive? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-01* cont.c (rb_fiber_start): calls with exact argument number.nobu
[ruby-core:20088] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-28* cont.c: Thread local storage should be fiber local.ko1
* bootstraptest/test_knownbug.rb, test/ruby/test_fiber.rb: move a fixed test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-07* test/ruby/test_fiber.rb (TestFiber::test_throw): uncaught throwmatz
now raise ArgumentError exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25* test/ruby/test_fiber.rb: fix to require 'continuation'.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25* cont.c: separate Continuation and Fiber from core.ko1
* ext/continuation/*, ext/fiber/*: ditto. * include/ruby/ruby.h: remove rb_cFiber. * include/ruby/intern.h: add the rb_fiber_new() declaration. * enumerator.c (next_init): fix to use rb_fiber_new(). * test/ruby/test_enumerator.rb: remove next? tests. * test/ruby/test_continuation.rb: add a require 'continuation'. * test/ruby/test_fiber.rb: add a require 'fiber'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-21* cont.c: add Fiber#resume and Fiber.yield.ko1
and Fiber::Core class to realize Coroutine. * include/ruby/intern.h: declare rb_fiber_yield(), rb_fiber_resume(), * enumerator.c: use above api. * test/ruby/test_fiber.rb: fix and add tests for above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-15* cont.c (rb_cont_call): forbid cross fiber continuation call.ko1
* test/ruby/test_fiber.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-07* cont.c (cont_restore_1): fix to check root fiber [ruby-dev:30911].ko1
* test/ruby/test_fiber.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-06* test_fiber.rb: add a test (Continuation and Fiber).ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-06* cont.c (cont_new): add debug message.ko1
* cont.c (cont_restore_1): copy stack information from fiber. * cont.c (rb_fiber_s_new): fix to mark created fiber. * test/ruby/test_fiber.rb: add some tests around Thread and Fiber. * yarvcore.c (thread_free): fix to skip freeing stack if root fiber is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05* cont.c (rb_fiber_start): clear th->tag and check error to fixko1
[ruby-dev:30888] and [ruby-dev:30889]. * eval_intern.h: fix rb_fiber_start() prototype. * test/ruby/test_fiber.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-02* cont.c (Fiber#pass): rename to Fiber#yield. Block parameterko1
of fiber body receive first yield values. e.g.: Fiber.new{|x| p x}.yield(:ok) #=> :ok * cont.c: rename rb_context_t#retval to rb_context_t#value. * test/ruby/test_fiber.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-27* cont.c: support Fiber. Check test/ruby/test_fiber.rb for detail.ko1
Fiber is known as "Micro Thread", "Coroutine", and other terms. At this time, only Fiber#pass is supported to change context. I want to know more suitable method name/API for Fiber (... do you know more suitable class name instead of Fiber?) as "suspend/resume", "call", "yield", "start/kick/stop/restart", .... * eval.c, eval_intern.h, thread.c, yarvcore.c, yarvcore.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e