[Adium-devl] Importer API

Ofri Wolfus ofri.wolfus at gmail.com
Thu Apr 12 18:36:50 UTC 2007


When you present it this way, I'm convinced :)

BTW, if creation of the temp dir is done with NSFileManager, it  
should be in the main thread as NSFM is not thread safe IIRC.

- Ofri

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


On 12/04/2007, at 21:16, Graham Booker wrote:

>
> 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
>
>
> _______________________________________________
> Adium-devl mailing list
> Adium-devl at adiumx.com
> http://adiumx.com/mailman/listinfo/adium-devl_adiumx.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20070412/1cb4a2c3/attachment-0001.html>


More information about the devel mailing list