@@ -336,7 +336,17 @@ def _within_time_limit(start_time):
336336
337337
338338class ClientSession (object ):
339- """A session for ordering sequential operations."""
339+ """A session for ordering sequential operations.
340+
341+ :class:`ClientSession` instances are **not thread-safe or fork-safe**.
342+ They can only be used by one thread or process at a time. A single
343+ :class:`ClientSession` cannot be used to run multiple operations
344+ concurrently.
345+
346+ Should not be initialized directly by application developers - to create a
347+ :class:`ClientSession`, call
348+ :meth:`~pymongo.mongo_client.MongoClient.start_session`.
349+ """
340350 def __init__ (self , client , server_session , options , authset , implicit ):
341351 # A MongoClient, a _ServerSession, a SessionOptions, and a set.
342352 self ._client = client
@@ -461,6 +471,10 @@ def callback(session, custom_arg, custom_kwarg=None):
461471 however, ``with_transaction`` will return without taking further
462472 action.
463473
474+ :class:`ClientSession` instances are **not thread-safe or fork-safe**.
475+ Consequently, the ``callback`` must not attempt to execute multiple
476+ operations concurrently.
477+
464478 When ``callback`` raises an exception, ``with_transaction``
465479 automatically aborts the current transaction. When ``callback`` or
466480 :meth:`~ClientSession.commit_transaction` raises an exception that
0 commit comments