1 Star 0 Fork 0

seaupnice / xv6-labs-2021

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
answers-thread.txt 333 Bytes
一键复制 编辑 原始数据 按行查看 历史
seaupnice 提交于 2022-02-19 11:41 . my solution for thread lab exercise 2
insert() 中线程 1 执行 e->next = n; 语句, 线程 2 也执行该语句,
之后两个线程在分别执行 *p = e; 语句,这会造成先执行该语句的线程想添加的 key 丢失。
put() 中更新存在的 key 也会产生问题,如果两个线程先后执行 e->value = value; 语句,
会造成更新丢失。
C
1
https://gitee.com/seaupnice/xv6-labs-2021.git
git@gitee.com:seaupnice/xv6-labs-2021.git
seaupnice
xv6-labs-2021
xv6-labs-2021
c308aad14ef9d272fce6f4c7f2016afdb425615d

搜索帮助