summaryrefslogtreecommitdiff
path: root/cont.c
AgeCommit message (Collapse)Author
2022-03-24Add ISEQ_BODY macroPeter Zhu
Use ISEQ_BODY macro to get the rb_iseq_constant_body of the ISeq. Using this macro will make it easier for us to change the allocation strategy of rb_iseq_constant_body when using Variable Width Allocation. Notes: Merged: https://github.com/ruby/ruby/pull/5698
2022-03-18Fix potential memory leak at fiber poolNobuyoshi Nakada
Do not "allocate then wrap". It leaks the allocated memory if failed to create the wrapper. Notes: Merged: https://github.com/ruby/ruby/pull/5668
2022-03-18Fix compilation error with `RB_EXPERIMENTAL_FIBER_POOL`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5668
2022-03-15[DOC]Fix FreeBSD Bugzilla linkS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/5658
2022-03-13Fix conversion macro for `size_t`Nobuyoshi Nakada
2022-03-13Fix experimental Fiber::Pool definitionNobuyoshi Nakada
Toplevel `Pool` is too generic, and `struct fiber_pool` does not seem compatible with `rb_fiber_t`.
2022-01-19`rb_fiber_terminate` must not return [Bug #18497]Nobuyoshi Nakada
In a forked process from a fiber, the fiber becomes the only fiber, `fiber_switch` does nothing as there is no other fibers, `rb_fiber_terminate` does not terminate the fiber. In that case, reaches the end of `fiber_entry` finaly, which is declared as "COROUTINE" and should never return. Notes: Merged: https://github.com/ruby/ruby/pull/5468
2022-01-01Negative RBOOL usageNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5385
2021-12-21Tidy up fiber scheduler interface documentation for `address_resolve` and ↵Samuel Williams
`timeout_after`. Notes: Merged: https://github.com/ruby/ruby/pull/5315
2021-12-21Update cont.cSamuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5280
2021-12-21Add SchedulerInterface#timeout_after and #address_resolve docszverok
Notes: Merged: https://github.com/ruby/ruby/pull/5280
2021-12-21Document Fiber::SchedulerInterface#io_read and #io_writezverok
Notes: Merged: https://github.com/ruby/ruby/pull/5280
2021-11-30Fix conflicting declaration on SolarisNobuyoshi Nakada
SunC ``` "cont.c", line 24: identifier redeclared: madvise current : function(pointer to char, unsigned int, int) returning int previous: function(pointer to void, unsigned int, int) returning int : "/usr/include/sys/mman.h", line 232 ``` GCC ``` cont.c:24:12: error: conflicting types for 'madvise' 24 | extern int madvise(caddr_t, size_t, int); | ^~~~~~~ In file included from cont.c:16: /usr/include/sys/mman.h:232:12: note: previous declaration of 'madvise' was here 232 | extern int madvise(void *, size_t, int); | ^~~~~~~ ```
2021-11-30Workaround for implicit declaration of function 'madvise' on SolarisNaohisa Goto
On Solaris, madvise(3C) is NOT defined for SUS (XPG4v2) or later, but MADV_* macros are defined when __EXTENSIONS__ is defined. This may cause compile error on Solaris 10 with GCC when "-Werror=implicit-function-declaration" and "-D_XOPEN_SOURCE=600" are added by configure.
2021-09-30rb_fiber_raise(): add doxygen卜部昌平
Must not be a bad idea to improve documents. Notes: Merged: https://github.com/ruby/ruby/pull/4912
2021-09-20Expose `rb_fiber_raise` and tidy up the internal implementation.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4649
2021-09-02Suppress format-pedantic warningsNobuyoshi Nakada
2021-08-10Remove root_jmpbuf in rb_thread_structNobuyoshi Nakada
It has not been used since 1b82c877dfa72e8505ded149fd0e3ba956529d3f. Notes: Merged: https://github.com/ruby/ruby/pull/4725
2021-08-07Remove unneeded rb_fiber_transfer_kw declarationS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/4713
2021-08-02Using RBOOL macroS.H
Notes: Merged: https://github.com/ruby/ruby/pull/4695 Merged-By: nobu <nobu@ruby-lang.org>
2021-07-18Adjust styles [ci skip]Nobuyoshi Nakada
* --procnames-start-lines
2021-07-17cont.c: fix formatting of RDoc for Fiber classKazuki Yamaguchi
2021-07-01Replace copy coroutine with pthread implementation.Samuel Williams
2021-06-12cont.c: Replace "iff" with "if and only if"nagachika
2021-06-03Suppress clobbered warnings on Travis-CI ppc64le-linuxNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4550 Merged-By: nobu <nobu@ruby-lang.org>
2021-06-03Expose `rb_fiber_transfer` and `rb_fiber_transfer_kw`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4549
2021-04-26Fix some typos by spell checkerRyuta Kamizono
Notes: Merged: https://github.com/ruby/ruby/pull/4414
2021-03-30Fix handling of timeout accessing scheduler outside of non-blocking context.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4173
2021-03-29fiber context update for Mac OS.David CARLIER
it is more about memory accounting sake. At allocation time, we make clear we re possibly reusing regions marked as reusable. Noted also calls might not necessarily succeed at first so we do only when necessary. Notes: Merged: https://github.com/ruby/ruby/pull/4313
2021-03-22solaris/illumos build fix.David Carlier
Notes: Merged: https://github.com/ruby/ruby/pull/4301
2021-03-22[DOC] some methods of Fiber do not need to require anymore [Feature #17407]Kazuhiro NISHIYAMA
2021-03-12Renamed functions for Fiber singleton methodsNobuyoshi Nakada
2021-03-12Constified variables for getenvNobuyoshi Nakada
2021-02-24rb_fiber_terminate never returnsNobuyoshi Nakada
2021-02-22Send :fiber_switch event for almost every fiber_switch (#4207)nicholas a. evans
With this patch, TracePoint receives a `:fiber_switch` event for _almost_ every fiber switch. Previously, it would not be sent when an exception was going to be raised. Now the event should only be blockable by an interrupt (including `Thread#raise`) or a fatal error. Additionally, interrupts will now be checked on the return fiber _before_ re-raising the terminating unhandled exception. And a fiber that terminates with an unhandled exception no longer creates a pending interrupt on its thread. The exception will be raised in the return fiber the same way as `Fiber#raise`: using `cont.value` with `cont.argc == -1` I moved `rb_exc_raise` from `fiber_store` to the end of `fiber_switch` after _all_ of the other cleanup code: `fiber_stack_release`, `th->blocking` increment, `RUBY_VM_CHECK_INTS`, and `EXEC_EVENT_HOOK`. It seems to me that skipping those other cleanup steps may have also resulted in other bugs. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2021-02-09Expose scheduler as public interface & bug fixes. (#3945)Samuel Williams
* Rename `rb_scheduler` to `rb_fiber_scheduler`. * Use public interface if available. * Use `rb_check_funcall` where possible. * Don't use `unblock` unless the fiber was non-blocking. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2021-01-13Moved Fiber methods into core [Feature #17407]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4060
2021-01-05[DOC] Fix grammar: "is same as" -> "is the same as"Marcus Stollsteimer
2020-12-28Adjusted styles [ci skip]Nobuyoshi Nakada
2020-12-27Language tweaks to Fiber [doc]Marc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3995
2020-12-24Fix a typo [ci skip]Kazuhiro NISHIYAMA
2020-12-24Redocument non-blocking Fibers and schedulerzverok
* Document Fiber's method related to scheduling; * Extend Fiber's class docs with concepts of non-blocking fibers; * Introduce "imaginary" (documentation-only) class Fiber::SchedulerInterface to properly document how scheduler's methods should look. Notes: Merged: https://github.com/ruby/ruby/pull/3891
2020-12-24Review commentszverok
Notes: Merged: https://github.com/ruby/ruby/pull/3981
2020-12-24Redocument Fiber#transferzverok
Notes: Merged: https://github.com/ruby/ruby/pull/3981
2020-12-23Enable `Fiber.current` and `Fiber#alive?` call inside ractorDelton Ding
Notes: Merged: https://github.com/ruby/ruby/pull/3971
2020-12-21Update Fiber#backtrace doc [See bug #17408]Marc-Andre Lafortune
2020-12-21Document Fiber#backtrace and #backtrace_locationszverok
Notes: Merged: https://github.com/ruby/ruby/pull/3966
2020-12-12Let Fiber#raise work with transferring fibersnicholas a. evans
This automatically choosess whether to use transfer on a transferring fiber or resume on a yielding fiber. If the fiber is resuming, it raises a FiberError. Notes: Merged: https://github.com/ruby/ruby/pull/3795
2020-11-22Remove obsoleted internal/mjit.h inclusionTakashi Kokubun
:bow:
2020-11-21Make sure all threads are scanned on unload_unitsTakashi Kokubun
This has been a TODO since 79df14c04b. While adcf0316d1 covered the root_fiber of the initial thread, it didn't cover root_fibers of other threads. Now it's hooked properly in rb_threadptr_root_fiber_setup. With regards to "XXX: Is this mjit_cont `mjit_cont_free`d?", when rb_threadptr_root_fiber_release is called, although I'm not sure when th->root_fiber is truthy, fiber_free seems to call cont_free and mjit_cont_free. So mjit_conts of root_fibers seem to be freed properly.