python Python中的System V共享内存?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2219604/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-04 00:06:01  来源:igfitidea点击:

System V shared memory in Python?

pythonipcsysvshared-memory

提问by Matt Joiner

How can I make use of the shmat(), shmdt(), shmctl(), shmget()calls from Python? Are they hidden somewhere in the standard library?

如何使用Python中的shmat(), shmdt(), shmctl(),shmget()调用?它们是否隐藏在标准库中的某处?

Update0

更新0

I'm after System V bindings that can be found in the Ubuntu repositories, or Python standard libraries (now or in future releases).

我正在寻找可以在 Ubuntu 存储库或 Python 标准库(现在或将来的版本)中找到的 System V 绑定。

采纳答案by Ignacio Vazquez-Abrams

Google finds sysv_ipc.

谷歌发现sysv_ipc.

回答by Martin T?rnwall

If you don't want to use any non-standard Python libraries, perhaps you could wrap the functions you need yourself using ctypes?

如果您不想使用任何非标准的 Python 库,也许您可​​以使用ctypes包装您自己需要的函数?

回答by Jonathan Feinberg

This pageoffers a feature matrix to help you choose between the posix_ipc, sysv_ipc, and shmmodules.

此页面提供了一个功能矩阵,可帮助您在posix_ipcsysv_ipcshm模块之间进行选择。

回答by Nik Reiman

The processingpackage also supports shared memory objects, and works on unix/mac/windows.

处理包也支持共享存储器对象,并且适用于UNIX / MAC /窗口。