Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Commented Unassigned: Concurrency management and performance in TokenSeparatorProvider.cs [15208]

$
0
0
Concurrency seems not to be managed properly in TokenSeparatorProvider.cs:
* A lock is performed on a variable that is exposed externally (_tokens)
* A lock is not performed on a variable while it could be read/written by other
* Some search operations are performed more times then necessary (return _tokens.ContainsKey(item) && _tokens[item].TokenType == TokenType.Operator;)
* a mutex is not disposed

Suggestion:
* remove _isInitialized and _mutex
* initialize the dictionary in a static constructor
* implement public bool IsOperator(string item) using dictionary's TryGetValue method

Comments: I think it is the correcte way in fixing the race conditions happening on the _tokens dictionary.

Viewing all articles
Browse latest Browse all 2262

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>