[sword-devel] Search thread saftey

Troy A. Griffitts sword-devel@crosswire.org
Fri, 25 Apr 2003 17:26:09 -0700


Will,
	First of all, SWORD is as thread safe as the client asks it to be.  For 
example:  You can create an SWMgr, ask it for a module, start a thread 
searching thru that module, then have another thread position that same 
module to, say, Jas 1:19.

This WILL PROBABLY NOT PRODUCE THE DESIRED BEHAVIOUR.  What will 
probably happen is that, whereever the search might be when the position 
call takes place, it will jump to that location and continue the search 
from there.  When the search is completed, it will position the module 
to where it was position before the search started, so the nobody's happy.


The best way to do is, and how we do it in BibleCS, is to have 2 SWMgr's 
-- one for displaying modules, and the other for searches.

Now, having said this, if the engine is crashing and you thing you 
should be ok, shoot me a snippet of the code you're running and I'll try 
to hunt down any bugs.

__________________


I'm not sure I understand your last question, but I think you might be 
asking about having an /etc/sword.conf that looks like this:

[Install]
DataPath=/usr/share/sword
AugmentPath=/mnt/card/usr/share/sword
AugmentPath=/mnt/cf/usr/share/sword

That's the default configuration we use on the Zaurus handheld, so it 
finds books in ram, on an SD memory card, and on a CF card.


Hope this helps,

	-Troy.




Will Thimbleby wrote:
> Hi,
> 
> I'm having problems getting MacSword to handle searching in a thread 
> without crashing. Is swords searching thread safe? If not is there a 
> work around. Otherwise I'll find the bugs in my code.
> 
> One other question, how can I get the SwordMgr to look in many different 
> places at the same time for module config files?
> 
> Cheers, Will
> 
> _______________________________________________
> sword-devel mailing list
> sword-devel@crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel