Re: Notification of file system modification arrives too early?
Re: Notification of file system modification arrives too early?
- Subject: Re: Notification of file system modification arrives too early?
- From: Antonio Nunes <email@hidden>
- Date: Fri, 28 May 2010 11:41:32 +0100
On 28 May 2010, at 11:30, Uli Kusterer wrote:
> The heuristic most people use is to wait a little time (a few seconds is usually enough) and only start processing a file if a new write notification hasn't arrived in the meantime. I usually use my UKPushbackMessenger for that purpose (see http://github.com/uliwitness/UliKit/blob/master/UKPushbackMessenger.h andhttp://github.com/uliwitness/UliKit/blob/master/UKPushbackMessenger.m).
Gruezi Uli,
I was hoping the system would provide something better for this. Looks like an enhancement request is in order.
Since PDF documents can potentially be huge, and I need to keep performance as good as possible, I need something more robust than waiting a few seconds. I am now experimenting with trying to read in a PDFDocument from the url, and not spawn the worker thread until this succeeds. Initial results look promising. The thread that sets up the task waits until it can successfully read in a PDFDocument from the URL, then releases the document and launches the task. I find this a bit of a hack, but if it works, it works, and I think this provides tighter performance than waiting for a set number of seconds (which may in extreme cases not to be long enough anyway).
Best,
António
-----------------------------------------------------------
Don't believe everything you think
-----------------------------------------------------------
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden