You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TEST_RUNNER_PORT_MIN: "14000"# Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache
6
6
CI_FAILFAST_TEST_LEAVE_DANGLING: "1"# Cirrus CI does not care about dangling processes and setting this variable avoids killing the CI script itself on error
@@ -13,9 +13,9 @@ env: # Global defaults
13
13
# Generally, a persistent worker must run Ubuntu 23.04+ or Debian 12+.
14
14
#
15
15
# The following specific types should exist, with the following requirements:
16
-
# - small: For an x86_64 machine, recommended to have 2 CPUs and 8 GB of memory.
17
-
# - medium: For an x86_64 machine, recommended to have 4 CPUs and 16 GB of memory.
18
-
# - arm64: For an aarch64 machine, recommended to have 2 CPUs and 8 GB of memory.
16
+
# - small: For an x86_64 machine, with at least 2 vCPUs and 8 GB of memory.
17
+
# - medium: For an x86_64 machine, with at least 4 vCPUs and 16 GB of memory.
18
+
# - arm64: For an aarch64 machine, with at least 2 vCPUs and 8 GB of memory.
19
19
#
20
20
# CI jobs for the latter configuration can be run on x86_64 hardware
21
21
# by installing qemu-user-static, which works out of the box with
@@ -36,14 +36,13 @@ env: # Global defaults
36
36
# This requires installing Podman instead of Docker.
37
37
#
38
38
# Futhermore:
39
-
# - apt-get is required due to PACKAGE_MANAGER_INSTALL
40
39
# - podman-docker-4.1+ is required due to the bugfix in 4.1
Copy file name to clipboardExpand all lines: doc/design/multiprocess.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,7 @@ This section describes the major components of the Inter-Process Communication (
81
81
- In the generated code, we have C++ client subclasses that inherit from the abstract classes in [`src/interfaces/`](../../src/interfaces/). These subclasses are the workhorses of the IPC mechanism.
82
82
- They implement all the methods of the interface, marshalling arguments into a structured format, sending them as requests to the IPC server via a UNIX socket, and handling the responses.
83
83
- These subclasses effectively mask the complexity of IPC, presenting a familiar C++ interface to developers.
84
-
- Internally, the client subclasses generated by the `mpgen` tool wrap [client classes generated by Cap'n Proto](https://capnproto.org/cxxrpc.html#clients), and use them to send IPC requests.
84
+
- Internally, the client subclasses generated by the `mpgen` tool wrap [client classes generated by Cap'n Proto](https://capnproto.org/cxxrpc.html#clients), and use them to send IPC requests. The Cap'n Proto client classes are low-level, with non-blocking methods that use asynchronous I/O and pass request and response objects, while mpgen client subclasses provide normal C++ methods that block while executing and convert between request/response objects and arguments/return values.
85
85
86
86
### C++ Server Classes in Generated Code
87
87
- On the server side, corresponding generated C++ classes receive IPC requests. These server classes are responsible for unmarshalling method arguments, invoking the corresponding methods in the local [`src/interfaces/`](../../src/interfaces/) objects, and creating the IPC response.
@@ -94,7 +94,7 @@ This section describes the major components of the Inter-Process Communication (
94
94
-**Asynchronous I/O and Thread Management**: The library is also responsible for managing I/O and threading. Particularly, it ensures that IPC requests never block each other and that new threads on either side of a connection can always make client calls. It also manages worker threads on the server side of calls, ensuring that calls from the same client thread always execute on the same server thread (to avoid locking issues and support nested callbacks).
95
95
96
96
### Type Hooks in [`src/ipc/capnp/*-types.h`](../../src/ipc/capnp/)
97
-
-**Custom Type Conversions**: In [`src/ipc/capnp/*-types.h`](../../src/ipc/capnp/), function overloads of two `libmultiprocess` C++ functions, `mp::CustomReadField`and `mp::CustomBuildFields`, are defined. These overloads are used for customizing the conversion of specific C++ types to and from Cap’n Proto types.
97
+
-**Custom Type Conversions**: In [`src/ipc/capnp/*-types.h`](../../src/ipc/capnp/), function overloads of `libmultiprocess` C++ functions, `mp::CustomReadField`, `mp::CustomBuildField`, `mp::CustomReadMessage`and `mp::CustomBuildMessage`, are defined. These overloads are used for customizing the conversion of specific C++ types to and from Cap’n Proto types.
98
98
-**Handling Special Cases**: The `mpgen` tool and `libmultiprocess` library can convert most C++ types to and from Cap’n Proto types automatically, including interface types, primitive C++ types, standard C++ types like `std::vector`, `std::set`, `std::map`, `std::tuple`, and `std::function`, as well as simple C++ structs that consist of aforementioned types and whose fields correspond 1:1 with Cap’n Proto struct fields. For other types, `*-types.h` files provide custom code to convert between C++ and Cap’n Proto data representations.
99
99
100
100
### Protocol-Agnostic IPC Code in [`src/ipc/`](../../src/ipc/)
@@ -197,7 +197,7 @@ sequenceDiagram
197
197
- Upon receiving the request, the Cap'n Proto dispatching code in the `bitcoin-node` process calls the `getBlockHash` method of the `Chain`[server class](#c-server-classes-in-generated-code).
198
198
- The server class is automatically generated by the `mpgen` tool from the [`chain.capnp`](https://github.com/ryanofsky/bitcoin/blob/pr/ipc/src/ipc/capnp/chain.capnp) file in [`src/ipc/capnp/`](../../src/ipc/capnp/).
199
199
- The `getBlockHash` method of the generated `Chain` server subclass in `bitcoin-wallet` receives a Cap’n Proto request object with the `height` parameter, and calls the `getBlockHash` method on its local `Chain` object with the provided `height`.
200
-
- When the call returns, it encapsulates the return value in a Cap’n Proto response, which it sends back to the `bitcoin-wallet` process,
200
+
- When the call returns, it encapsulates the return value in a Cap’n Proto response, which it sends back to the `bitcoin-wallet` process.
201
201
202
202
5.**Response and Return**
203
203
- The `getBlockHash` method of the generated `Chain` client subclass in `bitcoin-wallet` which sent the request now receives the response.
@@ -232,7 +232,7 @@ This modularization represents an advancement in Bitcoin Core's architecture, of
232
232
233
233
-**Cap’n Proto struct**: A structured data format used in Cap’n Proto, similar to structs in C++, for organizing and transporting data across different processes.
234
234
235
-
-**client class (in generated code)**: A C++ class generated from a Cap’n Proto interface which inherits from a Bitcoin core abstract class, and implements each virtual method to send IPC requests to another process. (see also [components section](#c-client-subclasses-in-generated-code))
235
+
-**client class (in generated code)**: A C++ class generated from a Cap’n Proto interface which inherits from a Bitcoin Core abstract class, and implements each virtual method to send IPC requests to another process. (see also [components section](#c-client-subclasses-in-generated-code))
236
236
237
237
-**IPC (inter-process communication)**: Mechanisms that enable processes to exchange requests and data.
0 commit comments