Back to index

python3.2  3.2.2
Namespaces | Classes | Functions | Variables
multiprocessing Namespace Reference

Namespaces

namespace  connection
namespace  dummy
namespace  forking
namespace  heap
namespace  managers
namespace  pool
namespace  process
namespace  queues
namespace  reduction
namespace  sharedctypes
namespace  synchronize
namespace  util

Classes

class  ProcessError
class  BufferTooShort
class  TimeoutError
class  AuthenticationError

Functions

def Manager
def Pipe
def cpu_count
def freeze_support
def get_logger
def log_to_stderr
def allow_connection_pickling
def Lock
def RLock
def Condition
def Semaphore
def BoundedSemaphore
def Event
def Queue
def JoinableQueue
def Pool
def RawValue
def RawArray
def Value
def Array
def set_executable

Variables

string __version__ = '0.70a1'
list __all__
string __author__ = 'R. Oudkerk (r.m.oudkerk@gmail.com)'

Function Documentation

Install support for sending connections and sockets between processes

Definition at line 160 of file __init__.py.

00160 
00161 def allow_connection_pickling():
00162     '''
00163     Install support for sending connections and sockets between processes
00164     '''
00165     from multiprocessing import reduction
00166 
00167 #
00168 # Definitions depending on native semaphores
00169 #

def multiprocessing.Array (   typecode_or_type,
  size_or_initializer,
  kwds 
)
Returns a synchronized shared array

Definition at line 254 of file __init__.py.

00254 
00255 def Array(typecode_or_type, size_or_initializer, **kwds):
00256     '''
00257     Returns a synchronized shared array
00258     '''
00259     from multiprocessing.sharedctypes import Array
00260     return Array(typecode_or_type, size_or_initializer, **kwds)
00261 
00262 #
00263 #
00264 #

Here is the caller graph for this function:

def multiprocessing.BoundedSemaphore (   value = 1)
Returns a bounded semaphore object

Definition at line 198 of file __init__.py.

00198 
00199 def BoundedSemaphore(value=1):
00200     '''
00201     Returns a bounded semaphore object
00202     '''
00203     from multiprocessing.synchronize import BoundedSemaphore
00204     return BoundedSemaphore(value)

def multiprocessing.Condition (   lock = None)
Returns a condition object

Definition at line 184 of file __init__.py.

00184 
00185 def Condition(lock=None):
00186     '''
00187     Returns a condition object
00188     '''
00189     from multiprocessing.synchronize import Condition
00190     return Condition(lock)

Here is the caller graph for this function:

Returns the number of CPUs in the system

Definition at line 108 of file __init__.py.

00108 
00109 def cpu_count():
00110     '''
00111     Returns the number of CPUs in the system
00112     '''
00113     if sys.platform == 'win32':
00114         try:
00115             num = int(os.environ['NUMBER_OF_PROCESSORS'])
00116         except (ValueError, KeyError):
00117             num = 0
00118     elif 'bsd' in sys.platform or sys.platform == 'darwin':
00119         comm = '/sbin/sysctl -n hw.ncpu'
00120         if sys.platform == 'darwin':
00121             comm = '/usr' + comm
00122         try:
00123             with os.popen(comm) as p:
00124                 num = int(p.read())
00125         except ValueError:
00126             num = 0
00127     else:
00128         try:
00129             num = os.sysconf('SC_NPROCESSORS_ONLN')
00130         except (ValueError, OSError, AttributeError):
00131             num = 0
00132 
00133     if num >= 1:
00134         return num
00135     else:
00136         raise NotImplementedError('cannot determine number of cpus')

Here is the call graph for this function:

Here is the caller graph for this function:

Returns an event object

Definition at line 205 of file __init__.py.

00205 
00206 def Event():
00207     '''
00208     Returns an event object
00209     '''
00210     from multiprocessing.synchronize import Event
00211     return Event()

Here is the caller graph for this function:

Check whether this is a fake forked process in a frozen executable.
If so then run code specified by commandline and exit.

Definition at line 137 of file __init__.py.

00137 
00138 def freeze_support():
00139     '''
00140     Check whether this is a fake forked process in a frozen executable.
00141     If so then run code specified by commandline and exit.
00142     '''
00143     if sys.platform == 'win32' and getattr(sys, 'frozen', False):
00144         from multiprocessing.forking import freeze_support
00145         freeze_support()

Here is the call graph for this function:

Here is the caller graph for this function:

Return package logger -- if it does not already exist then it is created

Definition at line 146 of file __init__.py.

00146 
00147 def get_logger():
00148     '''
00149     Return package logger -- if it does not already exist then it is created
00150     '''
00151     from multiprocessing.util import get_logger
00152     return get_logger()

Here is the caller graph for this function:

def multiprocessing.JoinableQueue (   maxsize = 0)
Returns a queue object

Definition at line 219 of file __init__.py.

00219 
00220 def JoinableQueue(maxsize=0):
00221     '''
00222     Returns a queue object
00223     '''
00224     from multiprocessing.queues import JoinableQueue
00225     return JoinableQueue(maxsize)

Here is the caller graph for this function:

Returns a non-recursive lock object

Definition at line 170 of file __init__.py.

00170 
00171 def Lock():
00172     '''
00173     Returns a non-recursive lock object
00174     '''
00175     from multiprocessing.synchronize import Lock
00176     return Lock()

Here is the caller graph for this function:

def multiprocessing.log_to_stderr (   level = None)
Turn on logging and add a handler which prints to stderr

Definition at line 153 of file __init__.py.

00153 
00154 def log_to_stderr(level=None):
00155     '''
00156     Turn on logging and add a handler which prints to stderr
00157     '''
00158     from multiprocessing.util import log_to_stderr
00159     return log_to_stderr(level)

Returns a manager associated with a running server process

The managers methods such as `Lock()`, `Condition()` and `Queue()`
can be used to create shared objects.

Definition at line 89 of file __init__.py.

00089 
00090 def Manager():
00091     '''
00092     Returns a manager associated with a running server process
00093 
00094     The managers methods such as `Lock()`, `Condition()` and `Queue()`
00095     can be used to create shared objects.
00096     '''
00097     from multiprocessing.managers import SyncManager
00098     m = SyncManager()
00099     m.start()
00100     return m

Here is the caller graph for this function:

def multiprocessing.Pipe (   duplex = True)
Returns two connection object connected by a pipe

Definition at line 101 of file __init__.py.

00101 
00102 def Pipe(duplex=True):
00103     '''
00104     Returns two connection object connected by a pipe
00105     '''
00106     from multiprocessing.connection import Pipe
00107     return Pipe(duplex)

Here is the caller graph for this function:

def multiprocessing.Pool (   processes = None,
  initializer = None,
  initargs = (),
  maxtasksperchild = None 
)
Returns a process pool object

Definition at line 226 of file __init__.py.

00226 
00227 def Pool(processes=None, initializer=None, initargs=(), maxtasksperchild=None):
00228     '''
00229     Returns a process pool object
00230     '''
00231     from multiprocessing.pool import Pool
00232     return Pool(processes, initializer, initargs, maxtasksperchild)

Here is the caller graph for this function:

def multiprocessing.Queue (   maxsize = 0)
Returns a queue object

Definition at line 212 of file __init__.py.

00212 
00213 def Queue(maxsize=0):
00214     '''
00215     Returns a queue object
00216     '''
00217     from multiprocessing.queues import Queue
00218     return Queue(maxsize)

Here is the caller graph for this function:

def multiprocessing.RawArray (   typecode_or_type,
  size_or_initializer 
)
Returns a shared array

Definition at line 240 of file __init__.py.

00240 
00241 def RawArray(typecode_or_type, size_or_initializer):
00242     '''
00243     Returns a shared array
00244     '''
00245     from multiprocessing.sharedctypes import RawArray
00246     return RawArray(typecode_or_type, size_or_initializer)

def multiprocessing.RawValue (   typecode_or_type,
  args 
)
Returns a shared object

Definition at line 233 of file __init__.py.

00233 
00234 def RawValue(typecode_or_type, *args):
00235     '''
00236     Returns a shared object
00237     '''
00238     from multiprocessing.sharedctypes import RawValue
00239     return RawValue(typecode_or_type, *args)

Returns a recursive lock object

Definition at line 177 of file __init__.py.

00177 
00178 def RLock():
00179     '''
00180     Returns a recursive lock object
00181     '''
00182     from multiprocessing.synchronize import RLock
00183     return RLock()

Here is the caller graph for this function:

def multiprocessing.Semaphore (   value = 1)
Returns a semaphore object

Definition at line 191 of file __init__.py.

00191 
00192 def Semaphore(value=1):
00193     '''
00194     Returns a semaphore object
00195     '''
00196     from multiprocessing.synchronize import Semaphore
00197     return Semaphore(value)

Here is the caller graph for this function:

def multiprocessing.set_executable (   executable)
Sets the path to a python.exe or pythonw.exe binary used to run
child processes on Windows instead of sys.executable.
Useful for people embedding Python.

Definition at line 267 of file __init__.py.

00267 
00268     def set_executable(executable):
00269         '''
00270         Sets the path to a python.exe or pythonw.exe binary used to run
00271         child processes on Windows instead of sys.executable.
00272         Useful for people embedding Python.
00273         '''
00274         from multiprocessing.forking import set_executable
00275         set_executable(executable)

def multiprocessing.Value (   typecode_or_type,
  args,
  kwds 
)
Returns a synchronized shared object

Definition at line 247 of file __init__.py.

00247 
00248 def Value(typecode_or_type, *args, **kwds):
00249     '''
00250     Returns a synchronized shared object
00251     '''
00252     from multiprocessing.sharedctypes import Value
00253     return Value(typecode_or_type, *args, **kwds)

Here is the caller graph for this function:


Variable Documentation

Initial value:
00001 [
00002     'Process', 'current_process', 'active_children', 'freeze_support',
00003     'Manager', 'Pipe', 'cpu_count', 'log_to_stderr', 'get_logger',
00004     'allow_connection_pickling', 'BufferTooShort', 'TimeoutError',
00005     'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition',
00006     'Event', 'Queue', 'JoinableQueue', 'Pool', 'Value', 'Array',
00007     'RawValue', 'RawArray', 'SUBDEBUG', 'SUBWARNING',
00008     ]

Definition at line 46 of file __init__.py.

string multiprocessing.__author__ = 'R. Oudkerk (r.m.oudkerk@gmail.com)'

Definition at line 55 of file __init__.py.

Definition at line 44 of file __init__.py.