Skip to content

wip: test: Server-side thread pool#24

Closed
rustaceanrob wants to merge 1 commit into
2140-dev:masterfrom
rustaceanrob:26-5-29-try-make-pool
Closed

wip: test: Server-side thread pool#24
rustaceanrob wants to merge 1 commit into
2140-dev:masterfrom
rustaceanrob:26-5-29-try-make-pool

Conversation

@rustaceanrob

Copy link
Copy Markdown
Member

Comment thread tests/test.rs
#[tokio::test]
#[serial_test::parallel]
async fn mining_via_pool_concurrent_queries() {
with_init_client_and_thread_map(|client, thread_map, _thread| async move {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@plebhash @Shourya742 can you guys have a look at the result here and provide feedback on bitcoin-core/libmultiprocess#283 if any?

@rustaceanrob

Copy link
Copy Markdown
Member Author

xyzconstant/peer-observer@c67385a was more helpful for demonstration.

ryanofsky added a commit to bitcoin-core/libmultiprocess that referenced this pull request Jul 5, 2026
0e49d91 Add `makePool` method on `ThreadMap` (rustaceanrob)

Pull request description:

  This patch introduces a pool of threads to the `Connection` class, and allows this pool to be populated with the thread map via `makePool`. When a client thread is not set in a request context, it is delegated to the pool. This is unable to handle the guarentees with server-invoked callbacks that the current API offers, but these callbacks are not yet present in the interface.

  The pool is implemented as ~round-robin as it is simplest~ shortest queue, but perhaps the pool could be a queue of requests with work-stealing for threads that are available.

  This was raised to me by Rust users, as they did not particularly care where work is executed on the server-side, but they have to set the thread regardless.

  Tests in Rust can be seen here: 2140-dev/bitcoin-capnp-types#24

  ref: https://github.com/2140-dev/bitcoin-capnp-types/blob/master/tests/util/bitcoin_core.rs#L149
  ref: #281

ACKs for top commit:
  xyzconstant:
    re-ACK 0e49d91
  ViniciusCestarii:
    re-ACK  0e49d91
  ryanofsky:
    Code review ACK 0e49d91 just tweaking pool thread names since last review

Tree-SHA512: 560de2f2ee335f61addf25c6d50ba2e4b983280bf2098cbb85a8ae8da2c5439579d8ccac00543247c106d2e6ba3cabe87b2db0f22d86a8bf78044d1be94cc757
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