15.04.2013 Views

Core Python Programming (2nd Edition)

Core Python Programming (2nd Edition)

Core Python Programming (2nd Edition)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 18. Multithreaded <strong>Programming</strong><br />

Chapter Topics<br />

● Introduction/Motivation<br />

● Threads and Processes<br />

● Threads and <strong>Python</strong><br />

● thread Module<br />

● tHReading Module<br />

● Producer-Consumer Problem and the Queue Module<br />

● Related Modules<br />

In this section, we will explore the different ways you can achieve more parallelism in your code by<br />

using the multithreaded (MT) programming features found in <strong>Python</strong>. We will begin by differentiating<br />

between processes and threads in the first few of sections of this chapter. We will then introduce the<br />

notion of multithreaded programming. (Those of you already familiar with MT programming can skip<br />

directly to Section 18.3.5.) The final sections of this chapter present some examples of how to use the<br />

threading and Queue modules to accomplish MT programming with <strong>Python</strong>.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!