Quantcast
Channel: DotSpatial
Viewing all articles
Browse latest Browse all 3973

Closed Unassigned: TopologyPreservingSimplifier is not thread safe [25866]

$
0
0
Hello,

I noticed that `TopologyPreservingSimplifier` doesn't appear to be thread-safe. This is a bit of a bottleneck for my application. Since `Simplify` is a static method of this class, is there any way to make it more thread safe? Right now I am locking it manually as follows, but I don't know that this is the most performant or safest way for other people who may run into this issue.

```
private static readonly object _SimplifyLocker = new object();

//...

lock (_SimplifyLocker)
{
return TopologyPreservingSimplifier.Simplify(input, tolerance);
}

//...
```

Viewing all articles
Browse latest Browse all 3973

Trending Articles



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