Stream: git-wasmtime

Topic: wasmtime / issue #5059 c-api: allow top level API to set ...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2022 at 05:17):

flouthoc opened issue #5059:

Feature

Hi Folks, Thanks for creating this wonderful runtime. I was wondering if there are any plans to expose wasm-timeout at c-api level ?
It will allow users of c-api to timout the runtime as per the needs.

Benefit

Provides a timout knob for c-api users, giving more control to the end users.

Implementation

Maybe creating a top level interface and make timeout part of wasi_config_t could work ?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2022 at 05:17):

flouthoc edited issue #5059:

Feature

Hi Folks,

Thanks for creating this wonderful runtime. I was wondering if there are any plans to expose wasm-timeout at c-api level ?
It will allow users of c-api to timout the runtime as per the needs.

Benefit

Provides a timout knob for c-api users, giving more control to the end users.

Implementation

Maybe creating a top level interface and make timeout part of wasi_config_t could work ?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2022 at 05:20):

flouthoc commented on issue #5059:

If can understand that more than enough issues are already there and upstream maintainers are already busy, If the idea looks good I'd like to help by implementing this feature. :smile:

view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2022 at 05:20):

flouthoc edited a comment on issue #5059:

I can understand that more than enough issues are already there and upstream maintainers are already busy, If the idea looks good I'd like to help by implementing this feature. :smile:

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2022 at 14:39):

alexcrichton commented on issue #5059:

Wasmtime doesn't have a native timeout knob precisely in its embedding API, but the CLI offers a timeout option as built from other primitives in the embedding API. One mechanism for timeouts is epochs which is possible through wasmtime_engine_increment_epoch and wasmtime_config_epoch_interruption_set. Another option is possible through wasmtime_config_consume_fuel_set and wasmtime_context_add_fuel. Are you able to combine those to satisfy your embedding use case?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2022 at 14:56):

flouthoc commented on issue #5059:

Wasmtime doesn't have a native timeout knob precisely in its embedding API, but the CLI offers a timeout option as built from other primitives in the embedding API. One mechanism for timeouts is epochs which is possible through wasmtime_engine_increment_epoch and wasmtime_config_epoch_interruption_set. Another option is possible through wasmtime_config_consume_fuel_set and wasmtime_context_add_fuel. Are you able to combine those to satisfy your embedding use case?

@alexcrichton Thanks a lot for checking this, I'll give it a try today and comment back here :)


Last updated: Nov 22 2024 at 16:03 UTC