1

I'm trying to share an in-memory database between processes. I'm using Python's sqlite3. The idea is to create a file in /run/shm and use it as a database. Questions are:

  1. Is that safe? In particular: do read/write locks (fcntl) work the same in shm?
  2. Is that a good idea in the first place? I'd like to keep things simple and not have to create a separate database process.
4

1 回答 1

0

我已经用 shm 文件测试了 fcntl(在 Python 中),似乎锁定工作正常。实际上,从进程的角度来看,它是一个文件,操作系统可以正确处理所有内容。

我将保留这种架构,因为它足够简单,而且我没有看到任何(主要)缺点。

于 2013-11-15T15:03:32.400 回答