OSError:[Errno 35]资源暂时不可用

时间:2016-12-10 13:58:18

标签: python multiprocessing threadpool python-multiprocessing pool

mac os,python2.7 我使用多处理,但它失败了:

In [1]: from multiprocessing import Pool

In [2]: pool = Pool(30)

OSError                                   Traceback (most recent call last)
/Users/mac/Documents/python-f/ga_users_v4_multipro.py in <module>()
    141 
    142 if __name__ == '__main__':
--> 143   a,t=main()
    144 

/Users/mac/Documents/python-f/ga_users_v4_multipro.py in main()
    111     date_range.append(t.strftime('%Y-%m-%d'))
    112 
--> 113   pool = Pool(30)
    114   rrr=pool.map(get_report, date_range)
    115   pool.close()

/Users/mac/.edm/envs/edm/lib/python2.7/multiprocessing/__init__.pyc in Pool(processes, initializer, initargs, maxtasksperchild)
    230     '''
    231     from multiprocessing.pool import Pool
--> 232     return Pool(processes, initializer, initargs, maxtasksperchild)
    233 
    234 def RawValue(typecode_or_type, *args):

/Users/mac/.edm/envs/edm/lib/python2.7/multiprocessing/pool.pyc in __init__(self, processes, initializer, initargs, maxtasksperchild)
    157         self._processes = processes
    158         self._pool = []
--> 159         self._repopulate_pool()
    160 
    161         self._worker_handler = threading.Thread(

/Users/mac/.edm/envs/edm/lib/python2.7/multiprocessing/pool.pyc in _repopulate_pool(self)
    221             w.name = w.name.replace('Process', 'PoolWorker')
    222             w.daemon = True
--> 223             w.start()
    224             debug('added worker')
    225 

/Users/mac/.edm/envs/edm/lib/python2.7/multiprocessing/process.pyc in start(self)
    128         else:
    129             from .forking import Popen
--> 130         self._popen = Popen(self)
    131         _current_process._children.add(self)
    132 

/Users/mac/.edm/envs/edm/lib/python2.7/multiprocessing/forking.pyc in __init__(self, process_obj)
    119             self.returncode = None
    120 
--> 121             self.pid = os.fork()
    122             if self.pid == 0:
    123                 if 'random' in sys.modules:

OSError: [Errno 35] Resource temporarily unavailable

我使用谷歌搜索,但许多人说这是python中的一个已知问题。解决了吗? 我有什么办法可以解决它吗?

0 个答案:

没有答案