Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion Doc/library/concurrent.interpreters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ managed way.

With this in mind, the :mod:`!concurrent.interpreters` module provides
a :class:`queue.Queue` implementation, available through
:func:`create_queue`.
:func:`create_queue`.

.. _interp-object-sharing:

Expand Down Expand Up @@ -228,6 +228,23 @@ This module defines the following functions:

Initialize a new cross-interpreter queue and return a :class:`Queue`
object for it.
Queues created using the function ``create_queue`` can be used to
safely communicate between multiple interpreters. Since the interpreters
are isolated and do not share variables or data directly,
a queue provides a mechanism to exchange data between them.

Example::

from concurrent.interpreters import create_queue

q = create_queue()

# In one interpreter
q.put("Hello")

# In other interpreter
message = q.get()
print(message)


Interpreter objects
Expand Down