summaryrefslogtreecommitdiff
path: root/process.c
AgeCommit message (Collapse)Author
2023-09-12[DOC] RDoc for Process::Status (#8416)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-09-07[DOC] Fix up Process::Status#>>Nobuyoshi Nakada
2023-09-06[DOC] Rdoc for Process::Status (#8386)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-09-05[DOC] Fix for RDoc for Process.kill (#8370)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-09-05[DOC] Fix up markupNobuyoshi Nakada
2023-09-05[DOC] Fix signal listNobuyoshi Nakada
- Signal names can be symbols, as stated above. - Supported signals and those values are platform dependent. - Key sequences to send signal are configurable. - Fix description of signal 0. Co-authored-by: Peter Zhu <peter@peterzhu.ca> Notes: Merged: https://github.com/ruby/ruby/pull/8367 Merged-By: nobu <nobu@ruby-lang.org>
2023-09-04[DOC] RDoc for process.c (#8366)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-09-03[DOC] Process doc (#8363)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-09-02[DOC] RDoc for process.cBurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/8361
2023-09-02[DOC] RDoc for process.c (#8358)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-09-02[DOC] RDoc for process.c (#8353)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-08-31[DOC] RDoc for #spawn (#8342)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-08-31[DOC] RDoc for Kernel#system (#8309)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-08-29Expose `rb_process_status_wait` and hide `rb_process_status_waitv`. (#8316)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-08-29Validate the typed data before dereferencing the internal struct. (#8315)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-08-27[DOC] More on method exec (#8302)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-08-27Free all empty heap pages in Process.warmupPeter Zhu
This commit adds `free_empty_pages` which frees all empty heap pages and moves the number of pages freed to the allocatable pages counter. This is used in Process.warmup to improve performance because page invalidation from copy-on-write is slower than allocating a new page. Notes: Merged: https://github.com/ruby/ruby/pull/8257
2023-08-24[DOC] RDoc for Process (#8282)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-08-24[DOC] Process doc (#8279)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-08-24Fix compile error on older systems without clock_get*Bo Anderson
Notes: Merged: https://github.com/ruby/ruby/pull/8256
2023-08-23[DOC] RDoc for Process (#8253)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-08-07[DOC] RDoc for Process (#8179)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-07-31RDoc for module Process (#8141)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-08-01[DOC] Update description of `Process.daemon` argumentsNobuyoshi Nakada
These arguments can only be `true` or `false` now. Also add markups.
2023-07-26Process.warmup: precompute strings coderangeJean Boussier
This both save time for when it will be eventually needed, and avoid mutating heap pages after a potential fork. Instrumenting some large Rails app, I've witnessed up to 58% of String instances having their coderange still unknown. Notes: Merged: https://github.com/ruby/ruby/pull/8112
2023-07-17Implement Process.warmupJean Boussier
[Feature #18885] For now, the optimizations performed are: - Run a major GC - Compact the heap - Promote all surviving objects to oldgen Other optimizations may follow. Notes: Merged: https://github.com/ruby/ruby/pull/7662
2023-07-10Use `File::NULL` instead of hard coded null device namesNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8050
2023-06-01Hide the usage of `rb_io_t` where possible. (#7880)Samuel Williams
This retries the compatible parts of the previously reverted PR so we can continue to update related code without breaking backwards compatibility. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-06-01Revert "Hide most of the implementation of `struct rb_io`. (#6511)"NARUSE, Yui
This reverts commit 18e55fc1e1ec20e8f3166e3059e76c885fc9f8f2. fix [Bug #19704] https://bugs.ruby-lang.org/issues/19704 This breaks compatibility for extension libraries. Such changes need a discussion.
2023-05-30Hide most of the implementation of `struct rb_io`. (#6511)Samuel Williams
* Add rb_io_path and rb_io_open_descriptor. * Use rb_io_open_descriptor to create PTY objects * Rename FMODE_PREP -> FMODE_EXTERNAL and expose it FMODE_PREP I believe refers to the concept of a "pre-prepared" file, but FMODE_EXTERNAL is clearer about what the file descriptor represents and aligns with language in the IO::Buffer module. * Ensure that rb_io_open_descriptor closes the FD if it fails If FMODE_EXTERNAL is not set, then it's guaranteed that Ruby will be responsible for closing your file, eventually, if you pass it to rb_io_open_descriptor, even if it raises an exception. * Rename IS_EXTERNAL_FD -> RUBY_IO_EXTERNAL_P * Expose `rb_io_closed_p`. * Add `rb_io_mode` to get IO mode. --------- Co-authored-by: KJ Tsanaktsidis <ktsanaktsidis@zendesk.com> Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-05-21Put `rb_fork` back into process.cNobuyoshi Nakada
Now, calling `rb_fork` directly breaks the PID cache and the timer thread, so must use `rb_fork_ruby` or similar instead. Notes: Merged: https://github.com/ruby/ruby/pull/7834
2023-04-13[Feature #19590] Show the invalid clock argumentNobuyoshi Nakada
Include the failed clock argument in the error message from `Process.clock_gettime` and `Process.clock_getres`. Notes: Merged: https://github.com/ruby/ruby/pull/7687
2023-04-05[DOC] Clarify behavior of abort() with no argumentDaniel DeLorme
Since Ruby 2.7 it prints the message and backtrace of $! Fixes [Bug #19578] Notes: Merged: https://github.com/ruby/ruby/pull/7664
2023-04-04Revert "Fix transient heap mode"Aaron Patterson
This reverts commit 87253d047ce35e7836b6f97edbb4f819879a3b25. Revert "Implement `Process.warmup`" This reverts commit ba6ccd871442f55080bffd53e33678c0726787d2.
2023-04-04Implement `Process.warmup`Jean Boussier
[Feature #18885] For now, the optimizations performed are: - Run a major GC - Compact the heap - Promote all surviving objects to oldgen Other optimizations may follow. Notes: Merged: https://github.com/ruby/ruby/pull/7346
2023-04-04PID cache is never cleared where `fork` is not usedNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7649
2023-03-24Cache pid itself instead of converted VALUENobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7585
2023-03-23thread_pthread.c: Use a `fork_gen` to protect against fork instead of getpid()Jean Boussier
[Feature #19443] Until recently most libc would cache `getpid()` so this was a cheap check to make. However as of glibc version 2.25 the PID cache is removed and calls to getpid() always invoke the actual system call which significantly degrades the performance of existing applications. The reason glibc removed the cache is that some libraries were bypassing fork(2) by issuing system calls themselves, causing stale cache issues. That isn't a concern for Ruby as bypassing MRI's primitive for forking would render the VM unusable, so we can safely cache the PID. Notes: Merged: https://github.com/ruby/ruby/pull/7434
2023-03-22Suppress a compiler warning on GCC in process.cPeter Zhu
rb_pid_t is 32 bits on some platforms, which will cause a warning on GCC due to POSFIXABLE always returning true. include/ruby/internal/arithmetic/fixnum.h:43:31: warning: comparison is always true due to limited range of data type [-Wtype-limits] Notes: Merged: https://github.com/ruby/ruby/pull/7580
2023-03-20Mark cached pid if necessaryNobuyoshi Nakada
2023-03-20Cache `Process.pid`Jean Boussier
[Feature #19443] It's not uncommon for database client and similar network libraries to protect themselves from Process.fork by regularly checking Process.pid Until recently most libc would cache `getpid()` so this was a cheap check to make. However as of glibc version 2.25 the PID cache is removed and calls to `getpid()` always invoke the actual system call which significantly degrades the performance of existing applications. The reason glibc removed the cache is that some libraries were bypassing `fork(2)` by issuing system calls themselves, causing stale cache issues. That isn't a concern for Ruby as bypassing MRI's primitive for forking would render the VM unusable, so we can safely cache the PID. Notes: Merged: https://github.com/ruby/ruby/pull/7326
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-10Remove prototypes for functions that are no longer used. (#7497)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-03-10Accept `sleep(nil)` as sleep forever. (#7484)Samuel Williams
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-07Remove obsoleted functions in rjit.cTakashi Kokubun
2023-03-07Get rid of MJIT's special forkTakashi Kokubun
2023-03-06s/mjit/rjit/Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/7462
2023-03-06s/MJIT/RJIT/Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/7462