arkpar opened PR #1227 from a-thread-safe-api
to master
:
This makes
Module
implementSend
andSync
, allowing instances to be created and executed in different threads.Closes #777
arkpar updated PR #1227 from a-thread-safe-api
to master
:
This makes
Module
implementSend
andSync
, allowing instances to be created and executed in different threads.Closes #777
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
I personally think that this probably isn't the way we want to parallelize
Module
andStore
and such. This means that compilation is still entirely serialized and you can't compile multiple modules in parallel, one of the main usages of enabling parallelism. I think we need to work to continue to refactor and reimplement the guts ofCompiler
to make themSend
andSync
and use&self
.For example the
trampoline_park
field is going away in https://github.com/bytecodealliance/wasmtime/pull/957, and I don't think that the switch toAtomicPtr<T>
here is correct in that it's not ever modified, it's just a pointer.The main next change is to move
CodeMemory
to per-module instances, and then mutability shouldn't be needed on most of the fields here.
alexcrichton created PR Review Comment:
Instead of unsafely asserting send/sync for
FinishedFunctions
, could a newtype wrapper around*const [VMFunctionBody]
be made to narrow-the scope of send/sync? That way we're not unsafely asserting thread safety aboutDefinedFuncIndex
orBoxedSlice
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
I've worked pretty hard to remove
lazy_static
from most crates because it often behaves in susprising ways. I don't understand much about the GDB integration here, but I think it would be better to have an instanced lock and/or atomics to manage this.
yurydelendik submitted PR Review.
yurydelendik created PR Review Comment:
gdb will use
__jit_debug_descriptor
(see static below) on this module startup and during reactiving on__jit_debug_register_code
breakpoint AFAIK. The__jit_debug_descriptor
is a global symbol for entire module.
arkpar submitted PR Review.
arkpar created PR Review Comment:
Is it safe to assume there won't be any concurrent access here?
pepyakin closed without merge PR #1227.
Last updated: Nov 22 2024 at 17:03 UTC