Skip to content

fix(wasm): 关闭 pthreads 构建 - #2

Merged
Resonalofi merged 1 commit into
masterfrom
fix/wasm-single-thread
Aug 25, 2026
Merged

Resonalofi merged 1 commit into
masterfrom
fix/wasm-single-thread

Conversation

@Resonalofi

Copy link
Copy Markdown
Owner

No description provided.

浏览器需跨域隔离才能用共享内存,且 Worker 脚本受同源限制,
跨域 CDN 上的 pthreads 产物无法初始化。DFS 分区并行补上与
多算法并行同样的单线程守卫。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 25, 2026 04:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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
@Resonalofi
Resonalofi merged commit e326a53 into master Aug 25, 2026
10 checks passed
@Resonalofi
Resonalofi deleted the fix/wasm-single-thread branch August 25, 2026 04:41
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.

2 participants