RwLock HashMap Arc Mutex 파일

발행: (2026년 1월 4일 오후 06:38 GMT+9)
1 min read
원문: Dev.to

Source: Dev.to

코드 예시

pub struct Context {
    pub(crate) tools: HashMap>,
    pub(crate) fifos: tokio::sync::RwLock>>>,
 //                                ^                      ^   ^
}//          many fifos, but only  |    async ref counter |   | but only one will
 //           one active at a time |    because many file |   | be active at a time
 //                                |    refs could exist      

그림

Back to Blog

관련 글

더 보기 »