EPPlus
EPPlus copied to clipboard
Multiple threading operations on different worksheets can easily cause exceptions
The following code will be executed in a multi-threaded environment, even if it operates on different worksheets, it may still throw exceptions, similar to inserting existing keys in a dictionary.
Example: lock (_syncRoot) { workSheet = param.Package.Workbook.Worksheets.Add(param.ExportMetadata.Definition.WorkSheetName); }
Load(workSheet, param.ExportMetadata);
param.ExportMetadata.Definition.AdjustStyle(workSheet);
No, avoid using multiple threads on a single workbook. We will look into better multithreading support in coming versions.
Hi guys.
I'm using your EpPlus and encountered errors in multithreading. Is it possible to clarify what kind of work you are doing to improve stability? Thanks
P.S. Are there any effective methods that will help avoid problems with multithreading in current versions?