WrappedObject/Object/NativeMethod aren't genuinely Sync
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- リファクタリング
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 技術スタック
- rust
調査の方向性
Start by reading the linked comment on #324 and tracing the relationships among NativeMethod, Object, WrappedObject, and NoSendInterpreter. Compare the three approaches described in the issue, including how interpreter-specific closures and object transfer should work. Done means the chosen design makes the Send and Sync guarantees accurate without losing support for non-Send native methods.
索引モデルが issue の本文から書いたものです。
説明
This issue is born out of my comment on #324 about NativeMethod.
NativeMethod does not have type bounds enforcing that its contained closure is Send. Therefore Object and WrappedObject can't be Send either.
To avoid cluttering #324 - there's actually a reasonably straightforward fix for FixedRegisters, I'm going to continue the NativeMethod discussion here.
Firstly, should we allow non-Send NativeMethods for NoSendInterpreter? My feeling is yes, we should. It stands to reason that if you're using a non-Send interpreter you have a good reason for that, so we should accept closures that work with the types you're using.
Secondly, how?
The fact that WrappedObject can contain a NativeMethod (via Object), and NativeMethod refers to WrappedObject means there's effectively a cycle in type references.
I can think of three ways:
- Deal with horrendous generic types and bounds - I don't think there's a straightforward way of limiting the generic types, they'll touch pretty much every other type in the crate. I'm still not entirely sure it actually is even possible, because of the cycle in type references.
- Remove
NativeMethodfromObjectcompletely. ThenObjectis effectivelyAmlObject, we'd need aNonAmlObjectto holdNativeMethodand anything else we think of in future. Plus wrapper types that could hold either.- This would allow objects to be passed between two different interpreters, as they could be now.
- Turn
NativeMethodinto a kind of index - perhaps an AmlName, or even just an integer - then store the actual closures in a map in the namespace.- In this case, objects are less easily passed between two interpreters, as the NativeMethods would be different.
- I haven't fully worked out how any reference counting would work to ensure the closures are freed when needed, but it seems tractable.
I'd probably go for option 3, since it reduces the distinction between NativeMethod and other object types. This hopefully makes it less likely we'd introduce bugs related to it in future.
But thoughts from @IsaacWoods and anyone else interested are most welcome.
- 主要言語
- Rust
- スター
- 248
- フォーク
- 95
- 平均マージ
- 3日 14時間
- マージ済み PR(30日)
- 9
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-osdev/acpi のほかの issue
-
Incorrect pkglength can cause panic対応中かも @mikamikasuki が 19 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
rust-osdev/acpi#362 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
rust-osdev/acpi#354 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
rust-osdev/acpi#353 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
rust-osdev/acpi#336 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
rust-osdev/acpi#328 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
rust-osdev/acpi の issue をすべて見る
似ている issue
-
documentation priority:p2 type:chore
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
facebookincubator/scrut#60 ·
-
dispatch:sol-high documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
carrick-sh/carrick#768 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
correctness postgres tursopg
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
tursodatabase/turso#10442 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
ankitects/anki#5864 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信