[Adium-devl] Importer API

Graham Booker gbooker at cod3r.com
Thu Apr 12 18:16:50 UTC 2007


On Apr 12, 2007, at 12:10 PM, Ofri Wolfus wrote:

> Apparently I'm the only one in that opinion, but I still think  
> threading should be avoided whenever possible, especially when you  
> don't *need* another thread and its purpose just to keep the UI  
> responsive. In my previous suggestion, importLogWithError: is  
> invoked periodically by a runloop source, but it doesn't really  
> have to import one log at a time. Large logs can be imported in  
> parts and spread on multiple invocations of that method.
>
> I truly believe a bit of extra effort for these special log cases  
> is worth it if eliminates multi-threading headaches.
>

Actually, this sounds like a tremendous amount of more effort than  
thread safety.  Instead of making sure that the importer does things  
thread safe, it has to worry about:
- How big is this file, and will it take too long to import
- OK, if the file is too big, how do I split it up and save my state  
so I can continue on the next call
- Am I using any calls within libraries that in themselves take too  
long?

Truthfully, actions for importing log files should be safe without  
any concern for making them so.  They don't mess with Adium's  
structures, and they don't mess with the UI (that is what that one  
call is for).  All they do is read files, and write new ones.  Thread  
safety should be a non-issue.

It terms of splitting up large files, how do you do this when  
importing a file spends over 99% of its time in the call  
CFXMLParserParse?  This *is* the case with importing Fire's XML logs,  
and there really is no way to split it up.

> - Ofri
>
> - - - - - - - - - - - - - - - - - - -
> http://www.dpompa.com
> - - - - - - - - - - - - - - - - - - -
>
>


- Graham


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20070412/179b4706/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1601 bytes
Desc: not available
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20070412/179b4706/attachment.p7s>


More information about the devel mailing list