Skip to content

Commit a2491ca

Browse files
committed
readme: add a section about multi-threading model
The section describes how the connector should be used from several threads. Closes #110
1 parent 0abd399 commit a2491ca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
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` must be used in a single thread. For multi-threaded usage, one can create one or several `Connector` instances for each thread. Let me remind you that each `Connection` must be used only with `Connector` that has created it.
270+
271+
If one uses his own `Buffer` or `NetProvider` implementations in scenario with multi-threaded `Connector`, the must not share any state (must not have `static` fields, for example).

0 commit comments

Comments
 (0)