Skip to content

Migrate from containers-thread to moonpool#81

Merged
c-cube merged 6 commits intomasterfrom
simon/move-to-moonpool
Feb 8, 2026
Merged

Migrate from containers-thread to moonpool#81
c-cube merged 6 commits intomasterfrom
simon/move-to-moonpool

Conversation

@c-cube
Copy link
Member

@c-cube c-cube commented Feb 8, 2026

Replace containers-thread with moonpool for parallel execution. Pool size enforces parallelism, blocking queue manages CPU affinity resources.

Replace containers-thread with moonpool for parallel execution:

- Use Moonpool.Fifo_pool for thread pool management
- Use Moonpool.Fut for futures and async task execution
- Use Moonpool.Lock instead of CCLock for mutual exclusion
- Use Moonpool.Blocking_queue for task queue and resource management

Benefits:
- Pool size directly enforces parallelism limit (no need for semaphore)
- Modern OCaml 5.x compatible library with better scheduling

Key changes:
- Par_map.map_p: Create pool with num_threads=j, spawn futures, wait for results
- Par_map.map_with_resource: Use blocking queue for dynamic resource allocation
- Replace CCLock.with_lock with Moonpool.Lock.with_
- Replace CCThread operations with stdlib Thread operations
Relax moonpool constraint to >= 0.9
Update CI to test on 4.14.x, 5.1.x, 5.4.x
@c-cube c-cube force-pushed the simon/move-to-moonpool branch from 04c8d06 to 3cdec6b Compare February 8, 2026 02:48
- Use Linol.Lsp.Types instead of Lsp.Types
- Add uri_to_string helper for DocumentUri.to_string
- Update Diagnostic.create message parameter to use `String tag
- Add workDoneToken and partialResultToken parameters to LSP methods
- Implement spawn_query_handler using Thread.create
- Update SaveOptions to use `SaveOptions tag in config_sync_opts
This allows CI to run on PRs that target branches other than master,
such as feature branches.
@c-cube c-cube merged commit 048849f into master Feb 8, 2026
3 checks passed
@c-cube c-cube deleted the simon/move-to-moonpool branch February 8, 2026 14:09
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.

1 participant