Skip to content

Add runtime platform thread primitives#440

Merged
heartwilltell merged 1 commit into
mainfrom
codex/runtime-windows-scheduler
Apr 26, 2026
Merged

Add runtime platform thread primitives#440
heartwilltell merged 1 commit into
mainfrom
codex/runtime-windows-scheduler

Conversation

@heartwilltell

Copy link
Copy Markdown
Contributor

Summary

  • introduce run_platform.h for runtime TLS, threads, mutexes, condvars, CPU count, and Windows timer-queue callbacks
  • move scheduler M/P queues and channel locks off direct pthread types
  • add a Windows cooperative preemption timer path and make runtime CPU detection use the platform wrapper

Fixes #406

Test Plan

  • clang-format -i src/runtime/run_platform.h src/runtime/run_scheduler.h src/runtime/run_scheduler.c src/runtime/run_chan.c src/runtime/run_runtime_api.c
  • zig build
  • zig build test (passes with expected bad_check.run missing() negative diagnostic)
  • zig build test-runtime
  • zig build -Dtarget=x86_64-windows-gnu (expected failure in libxev Windows handle support, tracked by Enable libxev Windows backend (IOCP) #407)
  • zig build -Dtarget=x86_64-windows-gnu -Dlegacy-poller=true (runtime library compiles; build still fails in POSIX-only runtime test/bench helpers)

@heartwilltell heartwilltell self-assigned this Apr 26, 2026
@heartwilltell heartwilltell marked this pull request as ready for review April 26, 2026 21:33
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Apr 26, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
runlang 7e2918b Commit Preview URL

Branch Preview URL
Apr 26 2026, 09:42 PM

@heartwilltell heartwilltell force-pushed the codex/runtime-windows-scheduler branch from 7e2918b to e8a7fcf Compare April 26, 2026 21:47
@heartwilltell heartwilltell merged commit 66d18e5 into main Apr 26, 2026
14 checks passed
@heartwilltell heartwilltell deleted the codex/runtime-windows-scheduler branch April 26, 2026 21:50
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.

Port scheduler to Windows (threads, TLS, timers)

1 participant