Skip to main content

threading2: like the standard threading module, but awesomer.

This module is designed as a drop-in replacement and extension for the default “threading” module. It has two main objectives:

  • implement primitives using native platform functionality where possible

  • expose more sophisticated functionality where it can be done uniformly

The following extensions are currently implemented:

  • ability to set (advisory) thread priority

  • ability to set (advisory) CPU affinity at thread and process level

  • thread groups for simultaneous management of multiple threads

  • SHLock class for shared/exclusive (also known as read/write) locks

The following API niceties are also included:

  • all blocking methods take a “timeout” argument and return a success code

  • all exposed objects are actual classes and can be safely subclassed

This has currently only been tested on WinXP and Ubuntu Karmic; similar platforms should work OK, and other platforms should fall back to using sensible default behaviour, but I’m not making any guarantees at this stage.

Additional planned extensions include:

  • make stack_size a kwarg when creating a thread

  • native events, semaphores and timed waits on win32

  • native conditions and timed waits on pthreads platforms

  • native SHLock implementations (SRW on Win Vista+, pthread_rwlock)

Release files for threading2 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for threading2 0.3.1
File Size Uploaded
threading2-0.3.1.tar.gz 20.0 kB Details

Release files / threading2-0.3.1.tar.gz

Download URL threading2-0.3.1.tar.gz
Size 20.0 kB
Tags Source
SHA-256 checksum
How to use checksums
94b11388dd64b31b6ba8079f2d8d99abb2c18df21b2f2b5cb6464650445b19cc
BLAKE2b-256 checksum
How to use checksums
b53a283e51fa979d372139dc724d34ece957fbfc709b1ae7006b82ceb459fd4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.1 This release

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page