goalng
白小狮
技术改变人生
展开
-
golang G-M-P模型
GMP设计架构GMP分别代表什么?G:GoroutineM: OS ThreadP:抽象概念(Processor),类似cpu的作用,将G调度到M上,进行绑定简单的发展历史!Local RunQueue是什么?Global RunQueue是什么?Network poll起到什么作用?GMP 是如何配合工作的?...翻译 2020-03-30 21:10:07 · 2409 阅读 · 1 评论 -
golang http 连接超时和传输超时
golang 测试代码package mainimport ( "net/http" "net/url" "fmt" "io/ioutil" "time" "net" "crypto/tls")func TimeoutDialer(cTimeout time.Duration, rwTimeout t原创 2018-05-25 11:45:33 · 10458 阅读 · 1 评论 -
replication binlog坑
有这样一个场景,db表里面的字段是unsigned类型的,但是业务没有做严格校验,导致update这个字段为负数,确实也是更新失败了,但是binlog中记录的却是(-95) 165。因为我是用golang的replication包来同步binlog的,所以并没有做这个字段类型的校验,所以注意这个坑...原创 2018-12-26 22:00:05 · 303 阅读 · 0 评论