Socket.Server 'module' object has no attribute 'fork' 原因分析

Exception happened during processing of request from ('127.0.0.1', 65066)
Traceback (most recent call last):
File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_nobloc
self.process_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 545, in process_request
pid = os.fork()
AttributeError: 'module' object has no attribute 'fork'



原因:
`os.fork` isn't available on Windows.


由于Python是跨平台的,自然也应该提供一个跨平台的多进程支持。multiprocessing模块就是跨平台版本的多进程模块。
posted @ 2015-08-15 21:29  arhatlohan  阅读(2640)  评论(0编辑  收藏  举报