On 27 Dec 2007, at 1:47 AM, Adam R. Maxwell wrote: > > On Dec 26, 2007, at 4:11 PM, Christiaan Hofman wrote: > >> >> On 26 Dec 2007, at 9:11 PM, Adam R. Maxwell wrote: >> >>> I'll start documenting those classes; there are some weak >>> relationships that are tricky, and the interaction with SKSearch's >>> async searching adds more complexity. How about if we contemplate >>> this feature for a bit longer and release a new version in the >>> meantime? That would help limit the scope of potential bugs. >>> >>> -- >>> adam >> >> Thanks. > > No problem; hope that helps. Some of it took a while to recall. > >> Could BDSKSearchIndex be simplified by making it a subclass >> of BDSKAsynchronousDOServer? > > I don't think there's much benefit at this point; it would basically > replace a few ivars with others. Right now it's about as simple and > lightweight as you can get, since there are no NSConnections or > NSInvocations involved. Since all the updates are received via > notifications anyway, the queue/port approach works pretty well. If > we need more complicated interthread messaging in future, using a > BDSKAsynchronousDOServer would likely be more straightforward. > > -- > adam >
It could make the code a bit simpler and easier to read, I think. There would be no need for the notification queue and port as well as the lock, and the whole runIndexThread method could be removed. Notifications could just be forwarded to the server thread. processNotification is a bit weird (it should probably be split into a main thread and a worker thread method, as all notifications are initially received ion the main thread and processed through handleMachMessage: on the worker thread). Christiaan ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Bibdesk-develop mailing list Bibdesk-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-develop