- 1、背景
- 2、内存共享
- 3、示例
mmap是python的内置模块,用来实现内存共享。
所谓内存共享,一定指的是两个进程。因为同一个进程资源共享的,没什么问题!
python3.8.8中关于mmap.py中mmap类的定义如下:
class mmap(object):
"""
Windows: mmap(fileno, length[, tagname[, access[, offset]]])
Maps length bytes from the file specified by the file handle fileno,
and returns a mmap object. If length is larger than the current size
of the file, the file is extended to contain l


