This project has moved and is read-only. For the latest updates, please go here.

threading issues in trunk?

Topics: SharpMap Project, SharpMap v0.9 / v1.x
Dec 18, 2011 at 1:45 PM

I've made some experience with the current trunk and SharpMap.Demo.Wms samples (the one that I've developed in a specified branch).

Looks that sharpmap now is unable to draw tiles in a "concurrent" environment, like the one that exists in openlayers samples, when multiple tiles are requested at the same time: I suppose that some "caching" was introduced in GDI objects (I say this because I see GDI Exceptions and because something similar is present in 2.x branch, and generates similar issues), but I need to investigate more. 

I'm wrong with this? I plan to port my examples (from 0.9 0.9-GeoJSON branch) to the trunk, but with this code the examples aren't working, so maybe I can try to fix this first...

Dec 18, 2011 at 4:30 PM

Hi, I've also noticed this in some cases so i took the opportunity to look at it now.

It seems that the Pen and Brush objects are the ones throwing those exceptions in multithreaded environments when used at the same time from many threads.

I've added av Clone() method to Vector Style and changes vectorlayer to use a cloned Style for drawing and the problems did dissapear.

Could you also confirm that?
I don't know why this started to happen in the trunk, as far as i know the vector-style have always cached pen and brush objects?


Dec 18, 2011 at 4:31 PM

Oh, and.. i did check in my changes to the trunk.

Dec 18, 2011 at 4:31 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.