Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store Process.pid in a constant #2882

Closed
eregon opened this issue Feb 21, 2023 · 1 comment
Closed

Store Process.pid in a constant #2882

eregon opened this issue Feb 21, 2023 · 1 comment
Assignees

Comments

@eregon
Copy link
Member

eregon commented Feb 21, 2023

From https://bugs.ruby-lang.org/issues/19443 and https://twitter.com/_byroot/status/1628074771459059714.
Since truffleruby doesn't support fork there is no need to invalidate the pid, we can just store it in a constant and return that.

@eregon
Copy link
Member Author

eregon commented Feb 22, 2023

See ruby-concurrency/concurrent-ruby#991 (comment)
$$ already caches the value, so probably we can def Process.pid; $$; end and use Truffle::POSIX.getpid to initialize $$.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants