aboutsummaryrefslogtreecommitdiffstats
path: root/process.c
Commit message (Collapse)AuthorAgeFilesLines
* Embed exec_arg objectsJean Boussier2023-11-221-2/+4
| | | | | They are very ephemeral, so avoiding the malloc churn is desirable.
* Make Process::Status embeddedJean Boussier2023-11-211-11/+13
| | | | These are not very common, but they're very easy to convert.
* [DOC] RDoc for module Process (#8847)Burdette Lamar2023-11-081-8/+61
|
* Align comment [ci skip]Nobuyoshi Nakada2023-11-061-1/+1
|
* M:N thread scheduler for RactorsKoichi Sasada2023-10-121-29/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* [DOC] State the precision of `Process.times` as platform-definedNobuyoshi Nakada2023-10-031-0/+1
| | | | | Remove the bad example that can lead to misunderstanding as if this precision is defined in Ruby.
* [DOC] Another example for spawn (#8575)Burdette Lamar2023-10-011-8/+14
|
* [DOC] Fix minor inconsistenciesBurdetteLamar2023-09-271-8/+8
|
* [DOC] Fix link in process.cPeter Zhu2023-09-261-3/+3
|
* [DOC] Refactor doc in process.cBurdetteLamar2023-09-261-46/+22
|
* Process.warmup: invoke `malloc_trim` if availableJean Boussier2023-09-151-0/+1
| | | | | Similar to releasing free GC pages, releasing free malloc pages reduce the amount of page faults post fork.
* [Bug #19868] Deprecate `Process::Status#&` and `Process::Status#>>`Nobuyoshi Nakada2023-09-141-4/+8
|
* [Bug #19868] Suggest other Process::Status method for `&` and `>>`Nobuyoshi Nakada2023-09-141-0/+36
| | | | | | | | `Process::Status#&` and `Process::Status#>>` are provided only for the backward compatibility with older Ruby than 1.8 where `$?` was a `Fixnum`, and the knowledge about internals of system dependent macros is necessary to use them. Modern programs and libraries should not need these methods.
* Negative value to Process::Status method for compatibilityNobuyoshi Nakada2023-09-141-3/+16
|
* [DOC] RDoc for Process::Status (#8416)Burdette Lamar2023-09-121-77/+67
|
* [DOC] Fix up Process::Status#>>Nobuyoshi Nakada2023-09-071-1/+1
|
* [DOC] Rdoc for Process::Status (#8386)Burdette Lamar2023-09-061-47/+42
|
* [DOC] Fix for RDoc for Process.kill (#8370)Burdette Lamar2023-09-051-38/+8
|
* [DOC] Fix up markupNobuyoshi Nakada2023-09-051-2/+2
|
* [DOC] Fix signal listNobuyoshi Nakada2023-09-051-34/+38
| | | | | | | | - 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>
* [DOC] RDoc for process.c (#8366)Burdette Lamar2023-09-041-27/+97
|
* [DOC] Process doc (#8363)Burdette Lamar2023-09-031-149/+180
|
* [DOC] RDoc for process.cBurdetteLamar2023-09-021-32/+43
|
* [DOC] RDoc for process.c (#8358)Burdette Lamar2023-09-021-52/+60
|
* [DOC] RDoc for process.c (#8353)Burdette Lamar2023-09-021-122/+138
|
* [DOC] RDoc for #spawn (#8342)Burdette Lamar2023-08-311-239/+88
|
* [DOC] RDoc for Kernel#system (#8309)Burdette Lamar2023-08-311-36/+112
|
* Expose `rb_process_status_wait` and hide `rb_process_status_waitv`. (#8316)Samuel Williams2023-08-291-1/+1
|
* Validate the typed data before dereferencing the internal struct. (#8315)Samuel Williams2023-08-291-2/+3
|
* [DOC] More on method exec (#8302)Burdette Lamar2023-08-271-5/+43
|
* Free all empty heap pages in Process.warmupPeter Zhu2023-08-271-2/+4
| | | | | | | 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.
* [DOC] RDoc for Process (#8282)Burdette Lamar2023-08-241-43/+54
|
* [DOC] Process doc (#8279)Burdette Lamar2023-08-241-21/+56
|
* Fix compile error on older systems without clock_get*Bo Anderson2023-08-241-0/+4
|
* [DOC] RDoc for Process (#8253)Burdette Lamar2023-08-231-110/+249
|
* [DOC] RDoc for Process (#8179)Burdette Lamar2023-08-071-60/+157
|
* RDoc for module Process (#8141)Burdette Lamar2023-07-311-13/+81
|
* [DOC] Update description of `Process.daemon` argumentsNobuyoshi Nakada2023-08-011-7/+6
| | | | These arguments can only be `true` or `false` now. Also add markups.
* Process.warmup: precompute strings coderangeJean Boussier2023-07-261-1/+1
| | | | | | | | 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.
* Implement Process.warmupJean Boussier2023-07-171-0/+34
| | | | | | | | | | | | [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.
* Use `File::NULL` instead of hard coded null device namesNobuyoshi Nakada2023-07-101-6/+8
|
* Hide the usage of `rb_io_t` where possible. (#7880)Samuel Williams2023-06-011-0/+1
| | | This retries the compatible parts of the previously reverted PR so we can continue to update related code without breaking backwards compatibility.
* Revert "Hide most of the implementation of `struct rb_io`. (#6511)"NARUSE, Yui2023-06-011-1/+0
| | | | | | | | | 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.
* Hide most of the implementation of `struct rb_io`. (#6511)Samuel Williams2023-05-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Put `rb_fork` back into process.cNobuyoshi Nakada2023-05-211-0/+11
| | | | | Now, calling `rb_fork` directly breaks the PID cache and the timer thread, so must use `rb_fork_ruby` or similar instead.
* [Feature #19590] Show the invalid clock argumentNobuyoshi Nakada2023-04-131-6/+15
| | | | | Include the failed clock argument in the error message from `Process.clock_gettime` and `Process.clock_getres`.
* [DOC] Clarify behavior of abort() with no argumentDaniel DeLorme2023-04-051-1/+2
| | | | | | Since Ruby 2.7 it prints the message and backtrace of $! Fixes [Bug #19578]
* Revert "Fix transient heap mode"Aaron Patterson2023-04-041-34/+0
| | | | | | | | This reverts commit 87253d047ce35e7836b6f97edbb4f819879a3b25. Revert "Implement `Process.warmup`" This reverts commit ba6ccd871442f55080bffd53e33678c0726787d2.
* Implement `Process.warmup`Jean Boussier2023-04-041-0/+34
| | | | | | | | | | | | [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.
* PID cache is never cleared where `fork` is not usedNobuyoshi Nakada2023-04-041-0/+2
|