Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is nested duk_pcall_* from the same thread supported? #2539

Open
zheng-yu-yang opened this issue Jun 30, 2023 · 1 comment
Open

Is nested duk_pcall_* from the same thread supported? #2539

zheng-yu-yang opened this issue Jun 30, 2023 · 1 comment

Comments

@zheng-yu-yang
Copy link

Hi there,

I know a single duk_context instance is for called from the same native thread context, unless duk_suspend/duk_resume applied, but within the same thread context, when JS calls my duktape/C function, is the function allowed to call duk_pcall to trap into JS world again? I checked the document but no information on this was found.

Thanks in advance!

@svaarala
Copy link
Owner

Hi, a Duktape/C function can call into JS world again using duk_pcall(), duk_eval() etc freely. The only limitations to this are:

  • Size of the native stack (and JS call stack)
  • The code within such a call chain cannot do a coroutine/thread yield

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

No branches or pull requests

2 participants