Repository navigation
fix(wasm): 关闭 pthreads 构建 - #2
Merged
Merged
Conversation
浏览器需跨域隔离才能用共享内存,且 Worker 脚本受同源限制, 跨域 CDN 上的 pthreads 产物无法初始化。DFS 分区并行补上与 多算法并行同样的单线程守卫。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
pthread-dependent code must be guarded or replaced before removing -pthread.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR disables pthread-based parallelism for Emscripten WASM builds and switches to serial execution.
Changes:
- Removes pthread compiler and linker options from CMake.
- Forces serial recommendation execution for non-pthread WASM builds.
File summaries
| File | Summary |
|---|---|
src/deck-recommend/base-deck-recommend.cpp |
Adds serial fallbacks, but pthread-dependent code remains compiled and may cause link failures. |
CMakeLists.txt |
Removes WASM pthread build options. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+185
to
+190
| #if defined(__EMSCRIPTEN__) && !defined(__EMSCRIPTEN_PTHREADS__) | ||
| // 单线程 WASM 构建没有线程支持,分区并行退化为串行 | ||
| const int configuredDfsThreads = 1; | ||
| #else | ||
| const int configuredDfsThreads = std::max(1, config.dfsParallelThreads); | ||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.