我注意到,当我在多线程上下文中使用 protobuf-net 时,它往往会间歇性地失败并出现以下错误:
System.TimeoutException: Timeout while inspecting metadata; this may indicate a deadlock.
This can often be avoided by preparing necessary serializers during application initialization, rather than allowing multiple threads to perform the initial metadata inspection
但是,如果我在第一次序列化特定类型时锁定对 protobuf-net 序列化程序的访问,它可以正常工作而不会失败。
protobuf-net 是否意味着线程安全,或者这只是一个错误?