Stream: wasmtime

Topic: ✔ ResourceLimiter: Send and async-ness changes


view this post on Zulip Graydon Hoare (Sep 25 2025 at 00:27):

this might be redundant with an existing thread (I'm not able to find anything that covers it directly) but .. PR https://github.com/bytecodealliance/wasmtime/pull/11442 (from @Alex Crichton back in august) changed ResourceLimiter to have a Send bound and this is somewhat problematic for my embedding. I don't entirely understand why it's necessary or even (I'm embarrassed to say) how Send and async fit together. or if they do at all. I guess it has to do with multi-threaded executors? I am only using and only wanting to use wasmtime (or at least the resources associated with a single Store) on a single thread at a time. is there any way I can eliminate the Send bound in that case, or conditionalize it?

(I suppose there is also the option of just declaring my ResourceLimiter type as Send, unsafely, knowing that it won't ever move between threads; but I feel a little bad doing that)

Upon further refactoring and thinking about #11430 I've realized that we might be able to sidestep T: Send on the store entirely which would be quite the boon if it can be pulled off. The reali...

view this post on Zulip Graydon Hoare (Sep 25 2025 at 01:16):

ah, I just realized there's a workaround I can manage -- forgot &mut itself is Send.

view this post on Zulip Notification Bot (Sep 25 2025 at 01:19):

Graydon Hoare has marked this topic as resolved.


Last updated: Dec 06 2025 at 06:05 UTC