threading

Module threading |
[hide private]
[frames] | no frames]

# Module threading

source code

Thread module emulating a subset of Java's threading model.

Classes | [hide private]
| Thread
| _BoundedSemaphore Semaphore that checks that # releases is <= # acquires
| _Condition
| _DummyThread
| _Event
| _MainThread
| _RLock
| _Semaphore
| _Timer Call a function after a specified number of seconds:
| _Verbose
| local Thread-local data

Functions | [hide private]
BoundedSemaphore(*args, **kwargs) | source code
Condition(*args, **kwargs) | source code
Event(*args, **kwargs) | source code
lock object |
Lock() (allocate() is an obsolete synonym) |
RLock(*args, **kwargs) | source code
Semaphore(*args, **kwargs) | source code
Timer(*args, **kwargs) | source code
_after_fork() | source code
_enumerate() | source code
_newname(template=`'``Thread-%d``'`) | source code
_pickSomeNonDaemonThread() | source code
_shutdown() | source code
_test() | source code
activeCount() | source code
active_count() | source code
currentThread() | source code
current_thread() | source code
enumerate() | source code
setprofile(func) | source code
settrace(func) | source code
size |
stack_size(size=...) Return the thread stack size used when creating new threads. |

Variables | [hide private]
| _VERBOSE = `False`
| __package__ = `None`
| _active = ``{`140735072995072`:` <_MainThread(MainThread, started 1`...``
| _active_limbo_lock = `<thread.lock object at 0x1053b40f0>`
| _counter = `0`
| _limbo = ``{``}``
| _profile_hook = `None`
| _trace_hook = `None`

Function Details | [hide private]

### Lock() |
(allocate() is an obsolete synonym) Create a new lock object. See LockType.__doc__ for information about locks. Returns: lock object

### stack_size(size=...) |
    Return the thread stack size used when creating new threads.  The
    optional size argument specifies the stack size (in bytes) to be used
    for subsequently created threads, and must be 0 (use platform or
    configured default) or a positive integer value of at least 32,768 (32k).
    If changing the thread stack size is unsupported, a ThreadError
    exception is raised.  If the specified size is invalid, a ValueError
    exception is raised, and the stack size is unmodified.  32k bytes
     currently the minimum supported stack size value to guarantee
    sufficient stack space for the interpreter itself.

    Note that some platforms may have particular restrictions on values for
    the stack size, such as requiring a minimum stack size larger than 32kB or
    requiring allocation in multiples of the system memory page size
    - platform documentation should be referred to for more information
    (4kB pages are common; using multiples of 4096 for the stack size is
    the suggested approach in the absence of more specific information).
Returns: size

Variables Details | [hide private]

  ### _active Value:
      {140735072995072: <_MainThread(MainThread, started 140735072995072)>}