Home
last modified time | relevance | path

Searched refs:WRITER (Results 1 – 2 of 2) sorted by relevance

/DragonOS-0.1.8/docs/kernel/locking/
Drwlock.md16 …k的数据结构进行访问和修改. 每个要访问共享数据的会获得一个守卫(guard), 只读进程获得READER(读者守卫),需要修改共享变量的进程获得WRITER(写者守卫),作为RwLock的"影子…
18WRITER, 还增加了UPGRADER; 这是一种介于READER和WRITER之间的守卫, 这个守卫的作用就是防止WRITER的饿死(Staration).当进程获得UPGRADER时,进程把…
23 …DER, 即可以同时有多个进程对共享数据进行访问;同一时间只能存在一个WRITER,而且当有一个进程获得WRITER时,不能存在READER和UPGRADER;进程获得UPGRADER的前提条件是…
50 #### 2.3.4 WRITER守卫的数据结构
75   (从右到左)第0位表征WRITER是否有效,若WRITER_BIT=1, 则存在一个进程获得了WRITER守卫; 若UPGRADER_BIT=1, 则存在一个进程获得了UPG…
93 ///功能: 获得WRITER守卫
97 ///功能: 尝试获得WRITER守卫
108 ### 3.2 WRITER守卫RwLockWriteGuard的主要API
110 ///功能: 将WRITER降级为READER
114 ///功能: 将WRITER降级为UPGRADER
[all …]
/DragonOS-0.1.8/kernel/src/libs/
Drwlock.rs24 const WRITER: u32 = 1; constant
137 if value & (WRITER | UPGRADED) != 0 { in inner_try_read()
172 return (self.lock.load(Ordering::Relaxed) & WRITER) / WRITER; in writer_count()
194 .compare_exchange(0, WRITER, Ordering::Acquire, Ordering::Relaxed) in inner_try_write()
235 if self.lock.fetch_or(UPGRADED, Ordering::Acquire) & (WRITER | UPGRADED) == 0 { in inner_try_upgradeable_read()
262 debug_assert!(self.lock.load(Ordering::Relaxed) & !WRITER > 0); in force_read_decrement()
271 debug_assert_eq!(self.lock.load(Ordering::Relaxed) & !(WRITER | UPGRADED), 0); in force_write_unlock()
272 self.lock.fetch_and(!(WRITER | UPGRADED), Ordering::Release); in force_write_unlock()
318 WRITER, in try_upgrade()
429 self.inner.lock.load(Ordering::Acquire) & (WRITER | UPGRADED), in downgrade_to_upgradeable()
[all …]