Go
Breath-Freely
爱技术,爱代码,爱写博客,爱讨论技术的单身狗。。
展开
-
Golang RWMutex 源码阅读
数据结构type RWMutex struct { w Mutex writerSem uint32 readerSem uint32 readerCount int32 readerWait int32 }w:互斥锁,多个写 goroutine之间竞争writerSem: 加写锁的信号量readerSem: 加读锁的信号量readerC...原创 2019-05-05 16:17:52 · 256 阅读 · 0 评论 -
Golang Timer源码阅读
数据结构type timer struct { tb *timersBucket // the bucket the timer lives in i int // heap index // Timer wakes up at when, and then at when+period, ... (period > 0 only) // each time...原创 2019-05-05 17:48:34 · 623 阅读 · 0 评论 -
Golang net/http包 client浅尝(一)
tcp链接client 包 一次完整请求client使用发起流程DosendRoundTripclient 包 一次完整请求client使用http.Client{ Transport: &http.Transport{ DialContext: (&net.Dialer{ Timeout: 30 * time.Second, //连接超时时间 ...原创 2019-05-12 15:53:42 · 1675 阅读 · 0 评论