python - python中multiprocessing.sharedctypes.Value和multiprocessing.Value的区别

标签 python multiprocessing ctypes

我阅读了 multiprocessing.Value 的文档 https://docs.python.org/2/library/multiprocessing.html#multiprocessing.Value

和 multiprocessing.sharedctypes.Value 的文档 https://docs.python.org/2/library/multiprocessing.html#multiprocessing.sharedctypes.Value

但无法弄清楚它们之间有什么区别。 有人知道吗? 谢谢!

最佳答案

至少在 python2.7 中,Value 就是 a wrapper function围绕 sharedctypes.Value,因此只有在进行某种奇怪的类型检查时,您才会注意到差异。

在 python3.6 中,看起来 Value 仍然只是 sharedctypes.Value 的包装器,但是 it takes care of passing an appropriate context .

关于python - python中multiprocessing.sharedctypes.Value和multiprocessing.Value的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42490839/

相关文章:

python - 如何在 Linux 上调用 Python 中的内联机器码?

Python:垃圾收集器行为与 ctypes

python - 将带有表单文件的curl命令转换为python请求

python - 需要有关以空格开头的正则表达式的帮助

python - 如何在另一个进程中运行一些 python 代码?

python - 比较多处理与扭曲的问题

python - 如何在Python中解决这个 'transpose'?

python - 给定值可能是不同类型的字典,如何将 python 字典简洁地转换为元组列表?

父导出上的 Python 多处理队列

python - ctypes MessageBoxW 返回意外的中文字符