【发布时间】:2012-05-24 10:54:53
【问题描述】:
我正在构建一个使用远程数据库的应用程序 - 它将 A 类型的对象保存到数据库,并从数据库读取 B 类型的对象。
由于saving models has the potential to block and release the GIL 和应用程序本身不使用保存的对象,我想将对.save() 的调用移至单独的线程。
我知道 Django 通常不是线程安全的。所以我的问题是 - 在另一个线程保存 A 类型的对象时查询 B 类型的对象是否有任何问题?
【问题讨论】:
标签: database django postgresql thread-safety gil