RFC 16: MapScript WxS Services

Frank Warmerdam warmerdam at POBOX.COM
Fri May 12 10:19:22 EDT 2006


Tamas Szekeres wrote:
> But the IO hooking part of the proposal seems to be painful and may result
> in a level of thread and host process affinity for the mapscript interface.

Tamas,

Note, I have proposed making the msIO handers thread local, so that each
thread can have independent handling of output routing.

> In my opinion instead of forcing the cgi style stdout technology, we should
> replace msIO_printf-s with the couterparts having the result as an out
> parameter. For example we should have msIO_sprintf, msIO_strcat etc.
> cgiRequestObj might have an additional member holding the accumulated result
> value.

This would require changing and reviewing and modifying an enormous
amount of code.  For me it just is not on the table.  And I am not clear
on what the benefit would be.

I would add that the cgiRequestObj currently is just used to manage
a set of name/value pairs and I don't think it would be a reasonable
"univeral io context".

> I'm not sure if the thread local stdio could be implemented easily. 

I have implemented thread local support the errorObj in maperror.c, and
lacking core "thread local" services from libmap, I would just use a similar
approach.  I am a bit concerned about performance overhead for higher level
code that might be doing a lot of very small msIO calls as each call will
require an extra few layers of indirection and a search for the threadlocal
io handlers in a linked list.

I would say that I am concerned that the proposed approach to install and
reset io handlers isn't all that clean and extendible.  If I install a
msIO buffer handler, and then call a function that wants to temporarily
install a different handler, it is clumsy for it to restore the old
state properly.  Currently I don't forsee much need for that, but even
the current approach means that some care needs to be taken to reset
msio handlers when processing a buffered request is done.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org



More information about the mapserver-dev mailing list