Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Use ScopedValue when available for thread context

オープン
#9,496 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
20/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
java

調査の方向性

The work centres on the ThreadContext lookup, which currently falls back to a ThreadLocal when Java code calls into JRuby. Start by finding where ThreadContext is obtained and every place ThreadLocal is used for it, then check how an optional ScopedValue path could be gated on the API being available (Java 25, or 21 with preview). Done means a feature-flagged path that reads the context through ScopedValue, with the ThreadLocal fallback still working. Expect design questions about rollout first, so ask the maintainers before coding.

索引モデルが issue の本文から書いたものです。

説明

ScopedValue, finalized in Java 25, provides a fast, JIT-friendly way to access values scoped to a given thread, similar to ThreadLocal values but without many of their shortcomings.

We currently use ThreadLocal in a number of places, but most notably for accessing the current ThreadContext for a given thread. Over the years, we have worked to propagate this value through our own call stacks, including through core methods and JIT-compiled code, but we still must fall back on a ThreadLocal whenever calling into JRuby from external code like Java libraries.

By modifying our ThreadContext management to use a ScopedValue, we can start to provide a fast path for Java 25+ users to reach the context without traversing a ThreadLocal. Eventually we will require Java 25 minimum and nearly all context accesses will be through ScopedValue.

This process should start in JRuby 10.1.x as an optional feature only available when the ScopedValue API is accessible. It should be automatically available in Java 25, and might also possibly be available in 21 with preview features turned on. We will need to evaluate whether that is functional enough to allow use prior to the full support in 25.

主要言語
Ruby
スター
3.9k
フォーク
951
平均マージ
2日 2時間
マージ済み PR(30日)
97

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

jruby/jruby のほかの issue

jruby/jruby の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。