go
go copied to clipboard
兼容标准json库的“API”是线程安全的吗
在高并发的场景,如果单例API的话,是否是线程(or go程)安全的嘞?
var json jsoniter.API
func init(){
// do once
extra.RegisterFuzzyDecoders()
json = jsoniter.ConfigCompatibleWithStandardLibrary
}
// 高并发调用
func Unmarshal(){
json.Unmarshal(xxx,xxx)
}
it is thread safe jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal