On Mon, 24 Mar 2003, David L Norris wrote:
> On Mon, 2003-03-24 at 21:39, greg wrote:
> > 1. I haven't been able to build an MFC application - because the MFC
> > framework
> > requires linking against multi-threaded versions of the C runtime
> > library.
> > Now I guess I can change the swish-e library to link against the
> > multi-threaded versions of the standard libraries...
> >
> > - does anyone know if that would be safe or not?
>
> Safe for search-only use. I'm not sure about indexing.
>
> Bill? Jose? Any insight?
Not for indexing for sure, but that's separate from the library.
I don't know if it's ever been tested with searching. I'm not sure what
all makes it thread safe, but a lot of attention has gone into localizing
data -- there are a few common buffers used but nothing I can think of
that would cause a problem. One example is the SwishResultPropertyStr()
function copies the property to a local buffer that is used for all
results. So if you do:
char *path1 = SwishResultPropertyStr( result1, "swishdocpath" );
then later for another result
char *path2 = SwishResultPropertyStr( result2, "swishdocpath" );
then it's likely that either path1 == path2, or path1 is no longer a valid
memory address. The reason I did that was so that the caller does not
need to either provide a buffer or need to worry about freeing the memory
allocated. Clearly, it would be better to just require a buffer to fill
(since that will be needed by the caller anyway).
--
Bill Moseley moseley@hank.org
Received on Tue Mar 25 03:42:28 2003