I'd bet that you'll strike out with this technique. In order to effectively multi-thread your serialization, you'd probably have to create multiple streams and combine them at the end. So any optimization you might get from multi-threading the stream creation is going to get eaten up by the merge process, since you have to go back and read the streams you just created. Trying to share the serialization stream across threads is probably not going to work, as the threads could essentially write the data out of order, and the de-serialization process wouldn't be able to re-construct the objects because the ordering wouldn't be predictable. In any event, you'd also have to write your serialization code to deal with that situation (i.e. your child-object streams need to know that you are only writing part of a stream, so that you don't create all the serialization header data.)
How large is "large"?
- Scott
Copyright (c) Marimer LLC