Skip to content

Commit b43fc4d

Browse files
readme: add a section about multi-threading model
The section describes how the connector should be used from several threads. Closes #110 Co-authored-by: Georgiy Lebedev <[email protected]>
1 parent ae004f3 commit b43fc4d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,9 @@ an array of tuples as value in response to `select`. So, in order to
263263
successfully decode them, we should pass an array of tuples to decoder - that's
264264
why `std::vector<UserTuple>` is needed. If decoding was successful, `results`
265265
will contain all decoded `UserTuples`.
266+
267+
## Multi-Threading Model
268+
269+
A `Connector` object and all its instances of `Connection` objects must be used in a single thread. For multi-threaded usage, create one or several `Connector` instances for each thread. Each `Connection` object must be used only with the `Connector` object that it was created from.
270+
271+
If custom `Buffer` or `NetProvider` implementations are used for `Connector` objects, the custom implementations must not share any state (e.g., `static` fields).

0 commit comments

Comments
 (0)