Low priority I / O on OS X

launchd has the ability to start a process with low priority I / O. How it works? (how low is the effect on all operations?)

Is there an API that allows low priority input / output in applications not running through launchd ?

I need to scan scanned (FSEvents) directories in a background application, and I would like it to be as soft as possible.

Alternatively, how can I check if the system / disk is busy with I / O?

+6
io scheduling macos
source share
1 answer

Launchd uses setiopolicy_np ( man page ), as seen from the source code here .

The standard FSEvents APIs described in this Apple document are pretty soft, so you don’t have to worry. This only means that something in the observed directory is changing.

If you really connect to /dev/fsevents and get raw data, you must be very careful not to overwhelm the system.

+4
source share

All Articles