Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libdummythread.tex @ 28646:193b8aec00ce legacy-trunk
Changes from Jonathan Riehl to allow his pgen extension (PEP 269) to
work. This includes some more code that used to be part of pgen in
the main parser; I'm okay with that. I'll see if the Windows build
needs work next.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 17 Apr 2003 14:55:42 +0000 |
| parents | 3bc2af41c016 |
| children |
| rev | line source |
|---|---|
|
26890
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
1 \section{\module{dummy_thread} --- |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
2 Drop-in replacement for the \module{thread} module} |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
3 |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
4 \declaremodule[dummythread]{standard}{dummy_thread} |
|
26897
3bc2af41c016
- fix use of \refmodule markup
Fred Drake <fdrake@acm.org>
parents:
26890
diff
changeset
|
5 \modulesynopsis{Drop-in replacement for the \refmodule{thread} module.} |
|
26890
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
6 |
|
26897
3bc2af41c016
- fix use of \refmodule markup
Fred Drake <fdrake@acm.org>
parents:
26890
diff
changeset
|
7 This module provides a duplicate interface to the \refmodule{thread} |
|
3bc2af41c016
- fix use of \refmodule markup
Fred Drake <fdrake@acm.org>
parents:
26890
diff
changeset
|
8 module. It is meant to be imported when the \refmodule{thread} module |
|
3bc2af41c016
- fix use of \refmodule markup
Fred Drake <fdrake@acm.org>
parents:
26890
diff
changeset
|
9 is not provided on a platform. |
|
26890
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
10 |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
11 Suggested usage is: |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
12 |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
13 \begin{verbatim} |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
14 try: |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
15 import thread as _thread |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
16 except ImportError: |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
17 import dummy_thread as _thread |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
18 \end{verbatim} |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
19 |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
20 Be careful to not use this module where deadlock might occur from a thread |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
21 being created that blocks waiting for another thread to be created. This |
|
8053bc0b8bb5
Brett Cannon's dummy_thread and dummy_threading modules (SF patch
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
22 often occurs with blocking I/O. |
