WrappedObject/Object/NativeMethod aren't genuinely Sync
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Refactorización
- Claridad
- Necesita aclaración
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- operating-systems
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 248
- Forks
- 95
- Merge medio
- 3 d 14 h
- PR fusionados (30 d)
- 9
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rust-osdev/acpi
-
Incorrect pkglength can cause panicPosiblemente ocupada @mikamikasuki la tomó hace 20 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
rust-osdev/acpi#362 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
rust-osdev/acpi#354 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
rust-osdev/acpi#353 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
rust-osdev/acpi#336 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
rust-osdev/acpi#328 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de rust-osdev/acpi
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
foxglove/mcap#1907 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
good first issue help wanted r-feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
servo/rust-smallvec#792 ·
Los mantenedores suelen responder en 1 día
-
A-Unicode C-bug P-low
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
rust-lang/rustfmt#7210 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
callTracer with withLog: true includes logs from a reverted top-level call (diverges from geth)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
paradigmxyz/revm-inspectors#570 ·
Los mantenedores suelen responder en 1 día