Logo     Photos

9 Member(s) Online

PyCon is a 100%
Volunteer-run
Conference Organized by
Members of the
Python
Community.

Site/Questions etc ?

Valid XHTML 1.0 Transitional

Valid CSS!

PyCon 2007 is sponsored
in part by
Zenoss - The Next Step in IT Management Google Microsoft .Net Framework EWT LLC Enthought, Inc. ITA Software
Platinum
Wingware Python IDE Accense Technology, Inc.
Gold
Quality Vision International Inc. MerchantCircle Big Nerd Ranch, Inc. High Speed Rails Canonical ZeOmega -- Open Minds' Open Solutions Open Source Applications Foundation CCP Games Tummy.com - we do linux AG Interactive ActiveState - Dynamic Tools for Dynamic Languages
Silver
Python411 Podcast Series O'Reilly Media, Inc.
Media

An Introduction to Stackless Python

Stackless Python is modified version of CPython with support for tasklets; also called microthreads, fibers or green threads. Tasklets are an additional way to implement multithreading but with much lower overhead than system threads. They take fewer system resources so a Stackless environment may have tens of thousands of active tasklets instead of at most a few hundred threads. Context switching and inter-tasklet communication via "channels" are fast, making Stackless a useful platform for developing dense multitasking systems.

The talk is meant for a intermediate level Python programmer who had heard about Stackless and wants to know why and when people use it. I will cover the basics of the Stackless API: starting tasklets, exchanging data and participating in its default collaborative scheduler. I'll show how to implement a standard boss/worker architecture then expand that to handle a simulation environment with a UI interface. I'll demonstrate how to use Stackless and an asynchronous I/O library to emulate blocking function calls so that existing blocking code works with Stackless' default collaborative scheduler.

Concepts to Cover


  • lightweight threads
  • async I/O
  • sync I/O
  • measuring, scheduling time
  • shifting priorities among threads
  • debugging your constellation of threads

Questions to Answer


  • Doesn't the addition of bidirectional generations to Python 2.5 render Stackless obsolete?
  • Isn't Stackless specific to CPython and lock me out of other implementations of Python, such as Jython, IronPython, Pirate (Parrot/Perl6) and PyPy?
Content Last Modified: October 31, 2006, at 12:17 PM