ObjectBox:并发写入事务
ObjectBox: Concurrent Write transactions
我看了 droidcon NYC 2017 speach of ObjectBox,其中有一部分是 Markus Junginger 谈论交易的(大约 25 分钟左右)。
本分钟的幻灯片指出:
No, we do not drop ACID: Transactions FTW!
- ObjectBox is fully transactional (ACID)
- Multi Version conurrency
Multi concurrent readers (read TX)
Single writer (write TX)
- implicit transaction
e.g. put(song), put(songList)
单写入器(写入 TX) 是否意味着我不能并行进行 2 个写入事务?
[编辑]
我可能已经找到答案了here
Write transactions are executed sequentially to ensure a consistent
state. Thus, it is advised to keep write transactions short to avoid
blocking other pending write transactions.
仍然很高兴得到任何答案。
您找到了正确的文档。每次总是一位作家。例如。任何时候只有一个 runInTx
(或 put
等)正在进行中。
更新:请注意,您不必担心自己使写入事务顺序化。如果多个线程想要同时写入(例如通过 put 或 runInTx),将选择其中一个线程先执行,而其他线程必须等待。它的工作方式就像 Java.
中的锁或同步
我看了 droidcon NYC 2017 speach of ObjectBox,其中有一部分是 Markus Junginger 谈论交易的(大约 25 分钟左右)。
本分钟的幻灯片指出:
No, we do not drop ACID: Transactions FTW!
- ObjectBox is fully transactional (ACID)
- Multi Version conurrency
Multi concurrent readers (read TX)
Single writer (write TX)- implicit transaction
e.g. put(song), put(songList)
单写入器(写入 TX) 是否意味着我不能并行进行 2 个写入事务?
[编辑]
我可能已经找到答案了here
Write transactions are executed sequentially to ensure a consistent state. Thus, it is advised to keep write transactions short to avoid blocking other pending write transactions.
仍然很高兴得到任何答案。
您找到了正确的文档。每次总是一位作家。例如。任何时候只有一个 runInTx
(或 put
等)正在进行中。
更新:请注意,您不必担心自己使写入事务顺序化。如果多个线程想要同时写入(例如通过 put 或 runInTx),将选择其中一个线程先执行,而其他线程必须等待。它的工作方式就像 Java.
中的锁或同步