Skip to content

Conversation

@dhil
Copy link
Member

@dhil dhil commented Mar 10, 2025

This patch is a stab at defining a prompt-oriented interface. I have
implemented a somewhat working version of it in Asyncify, though,
there are some caveats around forwarding. I think we need a trampoline
to make forwarding more robust.

dhil added 2 commits March 2, 2025 18:58
This patch abstracts away the fiber runtime initialisation and
finalisation procedures.
This patch is a stab at defining a prompt-oriented interface. I have
implemented a somewhat working version of it in Asyncify, though,
there are some caveats around forwarding. I think we need a trampoline
to make forwarding more robust.
@dhil dhil requested a review from ishmis March 10, 2025 17:03
$(ASYNCIFY) hello_prompt_asyncfiy.pre.wasm -o hello_prompt_asyncify.wasm
chmod +x hello_prompt_asyncify.wasm

hello_forward_prompt_asyncify.wasm: inc/fiber.h src/asyncify/asyncify_prompt_impl.c examples/prompt/hello_forward.c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the examples/prompt folder wasn't committed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The latest commit adds them.

// * ACTIVE: the fiber is actively executing.
// * YIELDING: the fiber is suspended.
// * DONE: the fiber is finished (i.e. run to completion).
typedef enum { ACTIVE, YIELDING, DONE, FORWARDING, YIELD_FORWARDING } fiber_state_t;
Copy link

@ishmis ishmis Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think YIELD_FORWARDING might not be used anywhere

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants