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模塊就是跨平台版本的多進程模塊。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM