[mapserver-users] Mapscript c# problem with multiple instances

Tamas Szekeres szekerest at gmail.com
Fri Sep 24 11:54:16 EDT 2010


James,

While it's not safe to use the same mapscript object by multiple threads
simultaneously, it should work when those threads operate on separate mapObj
instances.
This would pretty much similar to an ASP.NET application utilizing the
mapscript library which I've already used many times this way.

By all means it would be helpful if you could provide a sample project for
this in order to reproduce this behaviour.

Have you already tested with the recent versions of the packages available
from http://vbkto.dyndns.org/sdk/ ?


Best regards,

Tamas



2010/9/24 James Perrins <james.perrins at gmail.com>

> Hi,
>
> mapscript_csharp - 32 bit version 1.0.3679.25032 dated 10/1/2010
> All supporting DLLs from Tamas' nightly build site (was last stable
> version when I grabbed it in January)
> .NET 3.5
>
> Actually using this in desktop winform app.  All has been working
> fine, until I just tried to move the map rendering into a background
> thread to stop locking up the UI.
>
> No matter what I try - this seems to cause my app to crash out of the
> background thread (with no error)
> Crash always occurs at the point where I first try and do something
> with the OSGeo.MapServer.mapObj
> Initially it was when I tried to draw the map (having passed in a map
> object)
> So I then tried reading the map file again from the disk (so nothing
> was passed in) - in this case it fails when trying to create the map
> object from the map file.
> I tried extracting the code to a separate DLL (with only text strings
> passed in and out) - this still failed
> I then tried to run it as a separate AppDomain - which also failed.
>
> The only way I have it working to to actually call a separate exe
> using a temp .map file with my map state and having the exe write the
> image file back to disk for my main app to pick up.
> This does work - but seems rather a hack.
>
> Am I doing something wrong here / misunderstanding something ?  It
> seems almost as if I can only have one map object per application - or
> they are trampling on each other in some way I don't understand.
>
> Any ideas ?
>
> Thanks
> James
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100924/11945a5a/attachment.html


More information about the mapserver-users mailing list