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] question 关于多线程 #1950

Open
zwa73 opened this issue Dec 18, 2024 · 1 comment
Open

[Unity] question 关于多线程 #1950

zwa73 opened this issue Dec 18, 2024 · 1 comment

Comments

@zwa73
Copy link

zwa73 commented Dec 18, 2024

detail | 详细描述

用puerts在unity创建多个jsenv,然后在多线程中每个线程访问一个jsenv,以此来实现互不通讯只返回结果到c#的多线程js运算,这样会触发faq里的
"概率报Maximum call stack size exceeded"问题吗?

关于 THREAD_SAFE 宏,我只需在c#调用jsenv实例时
#if THREAD_SAFE
lock(jsenv){
#endif THREAD_SAFE
...

即可么?还是需要在哪里做额外改动?

@zwa73 zwa73 changed the title [Unity] question [Unity] question 关于多线程 Dec 18, 2024
@chexiongsheng
Copy link
Collaborator

1、要自己加--thread_safe参数编译plugin
2、Unity的Player Setting那加个THREAD_SAFE宏

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