@@ -232,11 +232,9 @@ Threads
232232How do I program using threads?
233233-------------------------------
234234
235- .. XXX it's _thread in py3k
236-
237- Be sure to use the :mod: `threading ` module and not the :mod: `thread ` module.
235+ Be sure to use the :mod: `threading ` module and not the :mod: `_thread ` module.
238236The :mod: `threading ` module builds convenient abstractions on top of the
239- low-level primitives provided by the :mod: `thread ` module.
237+ low-level primitives provided by the :mod: `_thread ` module.
240238
241239Aahz has a set of slides from his threading tutorial that are helpful; see
242240http://starship.python.net/crew/aahz/OSCON2001/.
@@ -280,16 +278,16 @@ A simple fix is to add a tiny sleep to the start of the run function::
280278
281279Instead of trying to guess how long a :func: `time.sleep ` delay will be enough,
282280it's better to use some kind of semaphore mechanism. One idea is to use the
283- :mod: `Queue ` module to create a queue object, let each thread append a token to
281+ :mod: `queue ` module to create a queue object, let each thread append a token to
284282the queue when it finishes, and let the main thread read as many tokens from the
285283queue as there are threads.
286284
287285
288286How do I parcel out work among a bunch of worker threads?
289287---------------------------------------------------------
290288
291- Use the :mod: `Queue ` module to create a queue containing a list of jobs. The
292- :class: `~Queue .Queue ` class maintains a list of objects with ``.put(obj) `` to
289+ Use the :mod: `queue ` module to create a queue containing a list of jobs. The
290+ :class: `~queue .Queue ` class maintains a list of objects with ``.put(obj) `` to
293291add an item to the queue and ``.get() `` to return an item. The class will take
294292care of the locking necessary to ensure that each job is handed out exactly
295293once.
@@ -777,11 +775,10 @@ Are there any interfaces to database packages in Python?
777775
778776Yes.
779777
780- .. XXX remove bsddb in py3k, fix other module names
781-
782- Python 2.3 includes the :mod: `bsddb ` package which provides an interface to the
783- BerkeleyDB library. Interfaces to disk-based hashes such as :mod: `DBM <dbm> `
784- and :mod: `GDBM <gdbm> ` are also included with standard Python.
778+ Interfaces to disk-based hashes such as :mod: `DBM <dbm.ndbm> ` and :mod: `GDBM
779+ <dbm.gnu> ` are also included with standard Python. There is also the
780+ :mod: `sqlite3 ` module, which provides a lightweight disk-based relational
781+ database.
785782
786783Support for most relational databases is available. See the
787784`DatabaseProgramming wiki page
@@ -794,8 +791,7 @@ How do you implement persistent objects in Python?
794791The :mod: `pickle ` library module solves this in a very general way (though you
795792still can't store things like open files, sockets or windows), and the
796793:mod: `shelve ` library module uses pickle and (g)dbm to create persistent
797- mappings containing arbitrary Python objects. For better performance, you can
798- use the :mod: `cPickle ` module.
794+ mappings containing arbitrary Python objects.
799795
800796A more awkward way of doing things is to use pickle's little sister, marshal.
801797The :mod: `marshal ` module provides very fast ways to store noncircular basic
0 commit comments