summaryrefslogtreecommitdiffstats
path: root/Lib/asyncore.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-02-04 15:39:30 (GMT)
committerGuido van Rossum <guido@python.org>2000-02-04 15:39:30 (GMT)
commit4b8c6eaf8b287a27e0054cf6c751448b2077e83b (patch)
treedfe117765389bf4415832ca888f0117f1feba0f3 /Lib/asyncore.py
parente7b146fb3bdca62a0d5ecc06dbf3348e5a4fe757 (diff)
downloadcpython-4b8c6eaf8b287a27e0054cf6c751448b2077e83b.zip
cpython-4b8c6eaf8b287a27e0054cf6c751448b2077e83b.tar.gz
cpython-4b8c6eaf8b287a27e0054cf6c751448b2077e83b.tar.bz2
Actually, the previous batch's comment should have been different;
*this* set of patches is Ka-Ping's final sweep: The attached patches update the standard library so that all modules have docstrings beginning with one-line summaries. A new docstring was added to formatter. The docstring for os.py was updated to mention nt, os2, ce in addition to posix, dos, mac.
Diffstat (limited to 'Lib/asyncore.py')
-rw-r--r--Lib/asyncore.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index 07b9fc3..8e11d76 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -25,6 +25,27 @@
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# ======================================================================
+"""Basic infrastructure for asynchronous socket service clients and servers.
+
+There are only two ways to have a program on a single processor do "more
+than one thing at a time". Multi-threaded programming is the simplest and
+most popular way to do it, but there is another very different technique,
+that lets you have nearly all the advantages of multi-threading, without
+actually using multiple threads. it's really only practical if your program
+is largely I/O bound. If your program is CPU bound, then pre-emptive
+scheduled threads are probably what you really need. Network servers are
+rarely CPU-bound, however.
+
+If your operating system supports the select() system call in its I/O
+library (and nearly all do), then you can use it to juggle multiple
+communication channels at once; doing other work while your I/O is taking
+place in the "background." Although this strategy can seem strange and
+complex, especially at first, it is in many ways easier to understand and
+control than multi-threaded programming. The module documented here solves
+many of the difficult problems for you, making the task of building
+sophisticated high-performance network servers and clients a snap.
+"""
+
import select
import socket
import string