| OLD | NEW |
| 1 # | 1 # |
| 2 # Package analogous to 'threading.py' but using processes | 2 # Package analogous to 'threading.py' but using processes |
| 3 # | 3 # |
| 4 # multiprocessing/__init__.py | 4 # multiprocessing/__init__.py |
| 5 # | 5 # |
| 6 # This package is intended to duplicate the functionality (and much of | 6 # This package is intended to duplicate the functionality (and much of |
| 7 # the API) of threading.py but uses processes instead of threads. A | 7 # the API) of threading.py but uses processes instead of threads. A |
| 8 # subpackage 'multiprocessing.dummy' has the same API but is a simple | 8 # subpackage 'multiprocessing.dummy' has the same API but is a simple |
| 9 # wrapper for 'threading'. | 9 # wrapper for 'threading'. |
| 10 # | 10 # |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 from multiprocessing.sharedctypes import RawValue | 221 from multiprocessing.sharedctypes import RawValue |
| 222 return RawValue(typecode_or_type, *args) | 222 return RawValue(typecode_or_type, *args) |
| 223 | 223 |
| 224 def RawArray(typecode_or_type, size_or_initializer): | 224 def RawArray(typecode_or_type, size_or_initializer): |
| 225 ''' | 225 ''' |
| 226 Returns a shared array | 226 Returns a shared array |
| 227 ''' | 227 ''' |
| 228 from multiprocessing.sharedctypes import RawArray | 228 from multiprocessing.sharedctypes import RawArray |
| 229 return RawArray(typecode_or_type, size_or_initializer) | 229 return RawArray(typecode_or_type, size_or_initializer) |
| 230 | 230 |
| 231 def Value(typecode_or_type, *args, lock=True): | 231 def Value(typecode_or_type, *args, **kwds): |
| 232 ''' | 232 ''' |
| 233 Returns a synchronized shared object | 233 Returns a synchronized shared object |
| 234 ''' | 234 ''' |
| 235 from multiprocessing.sharedctypes import Value | 235 from multiprocessing.sharedctypes import Value |
| 236 return Value(typecode_or_type, *args, lock=lock) | 236 return Value(typecode_or_type, *args, **kwds) |
| 237 | 237 |
| 238 def Array(typecode_or_type, size_or_initializer, *, lock=True): | 238 def Array(typecode_or_type, size_or_initializer, **kwds): |
| 239 ''' | 239 ''' |
| 240 Returns a synchronized shared array | 240 Returns a synchronized shared array |
| 241 ''' | 241 ''' |
| 242 from multiprocessing.sharedctypes import Array | 242 from multiprocessing.sharedctypes import Array |
| 243 return Array(typecode_or_type, size_or_initializer, lock=lock) | 243 return Array(typecode_or_type, size_or_initializer, **kwds) |
| 244 | 244 |
| 245 # | 245 # |
| 246 # | 246 # |
| 247 # | 247 # |
| 248 | 248 |
| 249 if sys.platform == 'win32': | 249 if sys.platform == 'win32': |
| 250 | 250 |
| 251 def set_executable(executable): | 251 def set_executable(executable): |
| 252 ''' | 252 ''' |
| 253 Sets the path to a python.exe or pythonw.exe binary used to run | 253 Sets the path to a python.exe or pythonw.exe binary used to run |
| 254 child processes on Windows instead of sys.executable. | 254 child processes on Windows instead of sys.executable. |
| 255 Useful for people embedding Python. | 255 Useful for people embedding Python. |
| 256 ''' | 256 ''' |
| 257 from multiprocessing.forking import set_executable | 257 from multiprocessing.forking import set_executable |
| 258 set_executable(executable) | 258 set_executable(executable) |
| 259 | 259 |
| 260 __all__ += ['set_executable'] | 260 __all__ += ['set_executable'] |
| OLD | NEW |