带有多处理的OSError 38 [Errno 38] [英] OSError 38 [Errno 38] with multiprocessing
本文介绍了带有多处理的OSError 38 [Errno 38]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我遇到以下错误:
$ sudo chmod a+rwxt /dev/shm/
$ ls -ld /dev/shm/
drwxrwxrwt 2 root root 4096 Feb 4 06:56 /dev/shm/
$ python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiprocessing
>>> mp = multiprocessing.Pool(2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/multiprocessing/__init__.py", line 227, in Pool
return Pool(processes, initializer, initargs)
File "/usr/lib/python2.6/multiprocessing/pool.py", line 84, in __init__
self._setup_queues()
File "/usr/lib/python2.6/multiprocessing/pool.py", line 131, in _setup_queues
self._inqueue = SimpleQueue()
File "/usr/lib/python2.6/multiprocessing/queues.py", line 328, in __init__
self._rlock = Lock()
File "/usr/lib/python2.6/multiprocessing/synchronize.py", line 117, in __init__
SemLock.__init__(self, SEMAPHORE, 1, 1)
File "/usr/lib/python2.6/multiprocessing/synchronize.py", line 49, in __init__
sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
OSError: [Errno 38] Function not implemented
除了(对/dev/shm的读/写访问权限之外),该错误还有什么其他原因?
What else could be the reason for this error (apart from read/write access to /dev/shm)?
谢谢!
推荐答案
For anyone else coming here from Google, the answer is at Django Celery Implementation - OSError errno 38 - Function not implemented:
通过将
none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0
添加到/etc/fstab
并重新启动
Got it working by adding
none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0
to/etc/fstab
and rebooting
sudo mount /dev/shm
可以重新启动,而不是重新启动.
Instead of rebooting, sudo mount /dev/shm
works.
这篇关于带有多处理的OSError 38 [Errno 38]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文