Low-priority I/O in OS X
launchd
has option to run process with low priority I/O. How does it work exactly? (how low is low, does it affect all operations?)
Is there an API that enables low priority I/O in applications not launched via launchd
?
I need to scan watched (FSEvents) directories in background application, and I'd like this to be as gentle as possible.
Alternatively, how can I check if system/disk is busy d开发者_如何学编程oing I/O?
Launchd uses setiopolicy_np
(man page), as can be seen in the source code here.
The standard FSEvents
APIs explained in this Apple doc is gentle enough, so you don't have to care. It only tells you the fact that something in a watched directory is changed.
If you really tap into /dev/fsevents
and get raw data, you need to be very careful not to overwhelm the system.
精彩评论