@@ -254,6 +254,7 @@ processes:
254
254
p.join()
255
255
256
256
Queues are thread and process safe.
257
+ Any object put into a :mod: `~multiprocessing ` queue will be serialized.
257
258
258
259
**Pipes **
259
260
@@ -281,6 +282,8 @@ processes:
281
282
of corruption from processes using different ends of the pipe at the same
282
283
time.
283
284
285
+ The :meth: `~Connection.send ` method serializes the the object and
286
+ :meth: `~Connection.recv ` re-creates the object.
284
287
285
288
Synchronization between processes
286
289
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -745,6 +748,11 @@ If you use :class:`JoinableQueue` then you **must** call
745
748
semaphore used to count the number of unfinished tasks may eventually overflow,
746
749
raising an exception.
747
750
751
+ One difference from other Python queue implementations, is that :mod: `multiprocessing `
752
+ queues serializes all objects that are put into them using :mod: `pickle `.
753
+ The object return by the get method is a re-created object that does not share memory
754
+ with the original object.
755
+
748
756
Note that one can also create a shared queue by using a manager object -- see
749
757
:ref: `multiprocessing-managers `.
750
758
@@ -811,6 +819,8 @@ For an example of the usage of queues for interprocess communication see
811
819
used for receiving messages and ``conn2 `` can only be used for sending
812
820
messages.
813
821
822
+ The :meth: `~multiprocessing.Connection.send ` method serializes the the object using
823
+ :mod: `pickle ` and the :meth: `~multiprocessing.Connection.recv ` re-creates the object.
814
824
815
825
.. class :: Queue([maxsize])
816
826
0 commit comments