1. 程式人生 > >Python多程序(multiprocessing)學習總結

Python多程序(multiprocessing)學習總結

    RawArray(typecode_or_type, size_or_initializer)
        Returns a shared array返回一個共享佇列 
    RawValue(typecode_or_type, *args)
        Returns a shared object返回一個共享物件    
    Semaphore(value=1)
        Returns a semaphore object返回一個訊號量物件  
    Value(typecode_or_type, *args, **kwds)
        Returns a synchronized shared object返回一個同步共享物件
    active_children()
        Return list of process objects corresponding to live child processes返回程序物件相對應活躍的的子程序列表 

    allow_connection_pickling()
        Install support for sending connections and sockets between processes支援程序間通訊 
    cpu_count()
        Returns the number of CPUs in the system返回CPU的核心數(實際是執行緒數,我的就是四核心八執行緒返回為8)
    current_process()
        Return process object representing the current process返回當前程序的程序物件
  
    freeze_support()
        Check whether this is a fake forked process in a frozen executable. If so then run code specified by commandline and exit.
    
    get_logger()
        Return package logger -- if it does not already exist then it is created
    
    log_to_stderr(level=None)
        Turn on logging and add a handler which prints to stderr
    
    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.