O'Reilly logo

Core Python Applications Programming, Third Edition by Wesley J. Chun

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Multithreaded Programming

> With Python you can start a thread, but you can’t stop it. > Sorry. You’ll have to wait until it reaches the end of execution. So, just the same as [comp.lang.python], then?

—Cliff Wells, Steve Holden(and Timothy Delaney), February 2002

In this chapter...

Introduction/Motivation

Threads and Processes

Threads and Python

The thread Module

The threading Module

Comparing Single vs. Multithreaded Execution

Multithreading in Practice

Producer-Consumer Problem and the Queue/queue Module

Alternative Considerations to Threads

Related Modules

In this section, we will explore the different ways by which you can achieve more parallelism in your code. We will begin by differentiating between processes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required