Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
eba87aa7
Commit
eba87aa7
authored
Dec 12, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explicit note about socket thread affinity. [skip ci]
parent
78a403e7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
doc/gevent.socket.rst
doc/gevent.socket.rst
+9
-1
No files found.
doc/gevent.socket.rst
View file @
eba87aa7
...
@@ -8,6 +8,14 @@ items in the standard :mod:`socket` module exactly, but the
...
@@ -8,6 +8,14 @@ items in the standard :mod:`socket` module exactly, but the
synchronous functions in this module only block the current greenlet
synchronous functions in this module only block the current greenlet
and let the others run.
and let the others run.
.. warning:: gevent's sockets have thread affinity. That is, they can
only be used from the operating system thread that
created them (any greenlet in that thread can use the
socket). The results of attempting to use the socket in
another thread (for example, passing it to the
threadpool) are not defined (but one common outcome is a
``LoopExit`` exception).
For convenience, exceptions (like :class:`error <socket.error>` and
For convenience, exceptions (like :class:`error <socket.error>` and
:class:`timeout <socket.timeout>`) as well as the constants from the
:class:`timeout <socket.timeout>`) as well as the constants from the
:mod:`socket` module are imported into this module.
:mod:`socket` module are imported into this module.
...
@@ -17,7 +25,7 @@ The exact API exposed by this module varies depending on what version
...
@@ -17,7 +25,7 @@ The exact API exposed by this module varies depending on what version
of Python you are using. The documents below describe the API for
of Python you are using. The documents below describe the API for
Python 2 and Python 3, respectively.
Python 2 and Python 3, respectively.
..
warning
:: All the described APIs should be imported from
..
caution
:: All the described APIs should be imported from
``gevent.socket``, and *not* from their implementation modules.
``gevent.socket``, and *not* from their implementation modules.
Their organization is an implementation detail that may change at
Their organization is an implementation detail that may change at
any time.
any time.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment