According to MSDN:
Any public static (Shared in Visual
Basic) members of this type are thread
safe. Any instance members are not
guaranteed to be thread safe.
So you need to synchronize access to Serialize/Deserialize methods.
Have you identified particular performance issues by creating a local serializer instance every time?
UPDATE:
I would trust MSDN because even if in some cases we can verify that instance members might be thread safe this doesn't mean that with the next service pack/update/framework version this will continue to be the case.
Looking with Reflector at BinaryFormatter constructor:
public BinaryFormatter()
{
this.m_typeFormat = FormatterTypeStyle.TypesAlways;
this.m_securityLevel = TypeFilterLevel.Full;
this.m_surrogates = null;
this.m_context = new StreamingContext(StreamingContextStates.All);
}
And StreamingContext constructor:
public StreamingContext(StreamingContextStates state, object additional)
{
this.m_state = state;
this.m_additionalContext = additional;
}
Quite frankly assigning 6 properties (most of which are enums
) should be blindingly fast. IMHO most of the time would be spent in Serialize/Deserialize methods.