Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple threading operations on different worksheets can easily cause exceptions #894

Open
iray1024 opened this issue Jun 6, 2023 · 2 comments
Labels
alt-enhancement alternative enchancement label for organization purposes

Comments

@iray1024
Copy link

iray1024 commented Jun 6, 2023

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);

@JanKallman
Copy link
Contributor

No, avoid using multiple threads on a single workbook. We will look into better multithreading support in coming versions.

@OssianEPPlus OssianEPPlus added the alt-enhancement alternative enchancement label for organization purposes label Feb 8, 2024
@happydaf
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alt-enhancement alternative enchancement label for organization purposes
Projects
None yet
Development

No branches or pull requests

4 participants