-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Potential race condition with concurrent read/write #689
Comments
author xuri <[email protected]> 1597421390 +0000 committer xuri <[email protected]> 1597481589 +0000 Compatible with Go 1.15, fix unit test failed on Windows and fixed #689 potential race condition
author xuri <[email protected]> 1597421390 +0000 committer xuri <[email protected]> 1597481589 +0000 Compatible with Go 1.15, fix unit test failed on Windows and fixed #689 potential race condition
@mlh758 Thanks for your feedback. I fixed race condition issues. Concurrent support will be impact normal r/w performance, slowdown about 20%, I will consider if or not support this feature later and optimize it. cc @hengmyj, @yinxiangjun. |
Sounds good. One more comment I have - you're using an |
…x-os#689 potential race condition
Description
I saw the announcement that this library now supports concurrent operations and this PR added an RWMutex to guard writes. It might be good to document the limitations of this.
Also it might be good to move the mutex into the File struct because this currently prevents writing to 2 different excel files concurrently, which was possible before.
Steps to reproduce the issue:
Describe the results you received:
Describe the results you expected:
Expected test to pass
Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.): MacOS
The locking also imposes some overhead for users who were using this without concurrency, or sticking to one file per thread:
Currently:
Version 2.2.0:
The overhead isn't too terrible, but we've had to deal with some performance issues in the past so a regression in that regard makes me a little uneasy. You might consider the potential for concurrent writes enough of a positive to offset the cost to write to a cell under normal conditions and if so feel free to disregard this part of the issue.
The text was updated successfully, but these errors were encountered: