gpt4 book ai didi

html - 本地存储和锁定

转载 作者:太空狗 更新时间:2023-10-29 13:24:15 24 4
gpt4 key购买 nike

由于 (html5) localStorage 及其等效项在选项卡和窗口之间持续存在,我考虑过使用它来传递消息。问题是 fetch 和 store 是不同的操作,因此不是原子的。我的模型依赖于 UUID 生成、冲突解决和信标来完成我需要做的一小部分工作,但我真正的问题是:

既然本地存储是共享内存资源,那么相互访问的锁机制有哪些?

最佳答案

Benjamin Dumke-von der Ehe 最近为 localStorage 提出了一些(实验性的)锁定代码:http://balpha.de/2012/03/javascript-concurrency-and-locking-the-html5-localstorage/

更新:文章中的代码链接已损坏,但是here on Github是代码,特意提到文章。

关于html - 本地存储和锁定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4528599/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com