[mapserver-users] Threads and Mapscript

Stephen Woodbridge woodbri at swoodbridge.com
Thu Mar 21 04:35:46 PST 2002


Harald,

mapserver is not thread-safe, I think the developers have start putting
mutex locking it but as you have found out it is not finnished. It also
crashes with PHP/mapscript if you do NOT build it as a CGI program.

-Steve W.

Harald Wehr wrote:
> 
> Using a cgi-script on a server for every request a new thread is opened,
> isn't it?
> 
> I use mapscript in a servlet. Every request makes a new thread. I save
> one mapObject in one java-session. Several requests (from different
> browsers) produce different mapObjects. Everything works right until
> here. I have different objects with different c-pointers.
> 
> Calling mapscript from one browser works fine. Calling it from another
> browser sometimes crashes my servlet-engine. It writes:
> "Unexpected exception outside virtual machine
> Function=msDrawRasterLayer+0x694
> Library=/urs/local/lib/libmapscript.so"
> This happens when i call the map.draw()-method. Do you have any suggestions?
> 
> What happens when i call
> "mapscipt.saveImage(pointer,"file.png",2,1,0,95)" from different
> threads? Is this thread-safe even in all depending libraries?
> 
> Asking the "mapscript.get_ms_error" from different threads I always get
> the same c-pointer of the error. Is this right? Can I somehow get
> error-Objects related to specific thread?
> 
> Harald



More information about the MapServer-users mailing list