golang fatal error: concurrent map read and map write

调试程序的时候,为了打印map中的内容 ,直接 使用seelog 的方法打印 map中的内容到日志,结果出现 “concurrent map read and map write”的错误,导致程序异常退出,后来将代码注释后恢复正常。猜想了下是log 打印属于写操作,取出map内容的时候属于读操作,log记录的时候产生lock引发异常。

 

具体细节就没研究,先mark下。

 

posted on 2017-07-14 11:22  iokde.com  阅读(1886)  评论(0编辑  收藏  举报

导航