facebooktwittermenuarrow-up

GemBox Support Forum

Multi-thread environment

Hi, my app produces excel files in high volume so I need to generate files with GemBox in parallel. I noticed the ExcelFile.Save() become very slow when it’s invoked concurrently from different threads.
did anyone encountered this behavior? does someone know if this is a a limitation in GemBox?

Thanks

Hi Shlomi,

First, the problem is that saving to the disc cannot be done in parallel.
However, saving to stream will also not be “perfect” parallel because the ZIP operations are sometimes non-parallel, atomic.

Nevertheless, the problem here is with what we’re expecting to get when executing multiple threads.
Creating multiple ExcelFile objects can put pressure to the memory and as a result, GC will be triggering. But other factors are involved as well.

In short, you can reproduce the same result with any other action as well, for instance, when creating multiple DataTable objects in parallel.

Regards,
Mario

Ok. Thank you Mario.