Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
TsinghuaDatabaseGroup committed Jun 4, 2023
1 parent 6ebc1c6 commit 791ae7a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 2 deletions.
Binary file added lec12/figs/rwfair.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lec12/figs/wfirst1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lec12/figs/wfirst2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions lec12/p6-labs.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ time cost is 919ms

---
### 程序设计
spin mutex和 block mutex 的核心数据结构: `UPSafeCell`
spin mutex和 block mutex 的核心数据结构**全局变量**`UPSafeCell`
```rust
pub struct UPSafeCell<T> { //允许在单核上安全使用可变全局变量
pub struct UPSafeCell<T> { //允许在单核上安全**使用可变全局变量**
inner: RefCell<T>, //提供内部可变性和运行时借用检查
}
unsafe impl<T> Sync for UPSafeCell<T> {} //声明支持全局变量安全地在线程间共享
Expand Down

0 comments on commit 791ae7a

Please sign in to comment.