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

[Unity] Bug: 使用backend v8异步加载并实例化wasm会一直挂起 #1702

Open
3 tasks done
richli-joyyou opened this issue Apr 16, 2024 · 2 comments
Open
3 tasks done
Assignees
Labels
bug Something isn't working Unity

Comments

@richli-joyyou
Copy link

前置阅读 | Pre-reading

Puer的版本 | Puer Version

2.0.4

Unity的版本 | Unity Version

2021.3

发生在哪个平台 | Platform

Android

错误信息 | Error Message

No response

问题重现 | Bug reproduce

异步加载并实例化wasm

@richli-joyyou richli-joyyou added bug Something isn't working Unity labels Apr 16, 2024
@richli-joyyou
Copy link
Author

richli-joyyou commented Apr 17, 2024

如果设置 "-sBINARYEN_ASYNC_COMPILATION=0" 编译出的wasm是可以正常加载的。 另外nodejs backend没有这个问题。同事建议加
// 用于处理v8的消息循环,以让后台异步Promise(WASM Compile)能够正常运行
// https://bugs.chromium.org/p/v8/issues/detail?id=12318#c1
while(ts_worker->m_v8mgr.PumpMessageLoop());
ts_worker->m_v8mgr.Isolate()->PerformMicrotaskCheckpoint(); //旧版v8叫RunIdleTasks

unity puerts这边我不知道怎么操作

@chexiongsheng
Copy link
Collaborator

unity可以导出到C#,然后在Update那调用。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Unity
Projects
None yet
Development

No branches or pull requests

2 participants