Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes
multiprocessing.process._MainProcess Class Reference
Inheritance diagram for multiprocessing.process._MainProcess:
Inheritance graph
[legend]
Collaboration diagram for multiprocessing.process._MainProcess:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def run
def start
def terminate
def join
def is_alive
def name
def name
def daemon
def daemon
def authkey
def authkey
def exitcode
def ident
def __repr__

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Static Public Attributes

 pid = ident

Private Attributes

 _identity
 _daemonic
 _name
 _parent_pid
 _popen
 _counter
 _children
 _authkey
 _tempdir

Detailed Description

Definition at line 308 of file process.py.


Constructor & Destructor Documentation

Definition at line 310 of file process.py.

00310 
00311     def __init__(self):
00312         self._identity = ()
00313         self._daemonic = False
00314         self._name = 'MainProcess'
00315         self._parent_pid = None
00316         self._popen = None
00317         self._counter = itertools.count(1)
00318         self._children = set()
00319         self._authkey = AuthenticationString(os.urandom(32))
00320         self._tempdir = None

Here is the caller graph for this function:


Member Function Documentation

def multiprocessing.process.Process.__repr__ (   self) [inherited]

Definition at line 219 of file process.py.

00219 
00220     def __repr__(self):
00221         if self is _current_process:
00222             status = 'started'
00223         elif self._parent_pid != os.getpid():
00224             status = 'unknown'
00225         elif self._popen is None:
00226             status = 'initial'
00227         else:
00228             if self._popen.poll() is not None:
00229                 status = self.exitcode
00230             else:
00231                 status = 'started'
00232 
00233         if type(status) is int:
00234             if status == 0:
00235                 status = 'stopped'
00236             else:
00237                 status = 'stopped[%s]' % _exitcode_to_name.get(status, status)
00238 
00239         return '<%s(%s, %s%s)>' % (type(self).__name__, self._name,
00240                                    status, self._daemonic and ' daemon' or '')

Here is the call graph for this function:

def multiprocessing.process.Process.authkey (   self) [inherited]

Definition at line 188 of file process.py.

00188 
00189     def authkey(self):
00190         return self._authkey

Here is the caller graph for this function:

def multiprocessing.process.Process.authkey (   self,
  authkey 
) [inherited]
Set authorization key of process

Definition at line 192 of file process.py.

00192 
00193     def authkey(self, authkey):
00194         '''
00195         Set authorization key of process
00196         '''
00197         self._authkey = AuthenticationString(authkey)

Here is the call graph for this function:

def multiprocessing.process.Process.daemon (   self) [inherited]
Return whether process is a daemon

Definition at line 173 of file process.py.

00173 
00174     def daemon(self):
00175         '''
00176         Return whether process is a daemon
00177         '''
00178         return self._daemonic

Here is the caller graph for this function:

def multiprocessing.process.Process.daemon (   self,
  daemonic 
) [inherited]
Set whether process is a daemon

Definition at line 180 of file process.py.

00180 
00181     def daemon(self, daemonic):
00182         '''
00183         Set whether process is a daemon
00184         '''
00185         assert self._popen is None, 'process has already started'
00186         self._daemonic = daemonic

Here is the call graph for this function:

def multiprocessing.process.Process.exitcode (   self) [inherited]
Return exit code of process or `None` if it has yet to stop

Definition at line 199 of file process.py.

00199 
00200     def exitcode(self):
00201         '''
00202         Return exit code of process or `None` if it has yet to stop
00203         '''
00204         if self._popen is None:
00205             return self._popen
00206         return self._popen.poll()

Here is the caller graph for this function:

def multiprocessing.process.Process.ident (   self) [inherited]
Return identifier (PID) of process or `None` if it has yet to start

Definition at line 208 of file process.py.

00208 
00209     def ident(self):
00210         '''
00211         Return identifier (PID) of process or `None` if it has yet to start
00212         '''
00213         if self is _current_process:
00214             return os.getpid()
00215         else:
00216             return self._popen and self._popen.pid

def multiprocessing.process.Process.is_alive (   self) [inherited]
Return whether process is alive

Definition at line 151 of file process.py.

00151 
00152     def is_alive(self):
00153         '''
00154         Return whether process is alive
00155         '''
00156         if self is _current_process:
00157             return True
00158         assert self._parent_pid == os.getpid(), 'can only test a child process'
00159         if self._popen is None:
00160             return False
00161         self._popen.poll()
00162         return self._popen.returncode is None

Here is the caller graph for this function:

def multiprocessing.process.Process.join (   self,
  timeout = None 
) [inherited]
Wait until child process terminates

Definition at line 141 of file process.py.

00141 
00142     def join(self, timeout=None):
00143         '''
00144         Wait until child process terminates
00145         '''
00146         assert self._parent_pid == os.getpid(), 'can only join a child process'
00147         assert self._popen is not None, 'can only join a started process'
00148         res = self._popen.wait(timeout)
00149         if res is not None:
00150             _current_process._children.discard(self)

Here is the caller graph for this function:

def multiprocessing.process.Process.name (   self) [inherited]

Definition at line 164 of file process.py.

00164 
00165     def name(self):
00166         return self._name

Here is the caller graph for this function:

def multiprocessing.process.Process.name (   self,
  name 
) [inherited]

Definition at line 168 of file process.py.

00168 
00169     def name(self, name):
00170         assert isinstance(name, str), 'name must be a string'
00171         self._name = name

Here is the call graph for this function:

Here is the caller graph for this function:

def multiprocessing.process.Process.run (   self) [inherited]
Method to be run in sub-process; can be overridden in sub-class

Reimplemented in test.test_multiprocessing._UpperCaser.

Definition at line 111 of file process.py.

00111 
00112     def run(self):
00113         '''
00114         Method to be run in sub-process; can be overridden in sub-class
00115         '''
00116         if self._target:
00117             self._target(*self._args, **self._kwargs)

Here is the caller graph for this function:

def multiprocessing.process.Process.start (   self) [inherited]
Start child process

Definition at line 118 of file process.py.

00118 
00119     def start(self):
00120         '''
00121         Start child process
00122         '''
00123         assert self._popen is None, 'cannot start a process twice'
00124         assert self._parent_pid == os.getpid(), \
00125                'can only start a process object created by current process'
00126         assert not _current_process._daemonic, \
00127                'daemonic processes are not allowed to have children'
00128         _cleanup()
00129         if self._Popen is not None:
00130             Popen = self._Popen
00131         else:
00132             from .forking import Popen
00133         self._popen = Popen(self)
00134         _current_process._children.add(self)

Here is the call graph for this function:

Here is the caller graph for this function:

def multiprocessing.process.Process.terminate (   self) [inherited]
Terminate process; sends SIGTERM signal or uses TerminateProcess()

Definition at line 135 of file process.py.

00135 
00136     def terminate(self):
00137         '''
00138         Terminate process; sends SIGTERM signal or uses TerminateProcess()
00139         '''
00140         self._popen.terminate()

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from multiprocessing.process.Process.

Definition at line 318 of file process.py.

Reimplemented from multiprocessing.process.Process.

Definition at line 317 of file process.py.

Reimplemented from multiprocessing.process.Process.

Definition at line 316 of file process.py.

Reimplemented from multiprocessing.process.Process.

Definition at line 312 of file process.py.

Reimplemented from multiprocessing.process.Process.

Definition at line 311 of file process.py.

Reimplemented from multiprocessing.process.Process.

Definition at line 313 of file process.py.

Reimplemented from multiprocessing.process.Process.

Definition at line 314 of file process.py.

Reimplemented from multiprocessing.process.Process.

Definition at line 315 of file process.py.

Reimplemented from multiprocessing.process.Process.

Definition at line 319 of file process.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

Definition at line 217 of file process.py.


The documentation for this class was generated from the following file: