Re: Prioritize my own app's disk access

2016-07-06 Thread Jonathan Taylor
On 6 Jul 2016, at 18:01, Quincey Morris wrote: > On Jul 6, 2016, at 03:06 , Jonathan Taylor > wrote: >> >> a single lost frame will be fairly catastrophic for the scientific experiment > > If this is genuinely your scenario, then nothing mentioned in this thread is > going to satisfy your re

Re: Prioritize my own app's disk access

2016-07-06 Thread Jens Alfke
> On Jul 6, 2016, at 3:06 AM, Jonathan Taylor > wrote: > > I should also clarify that (in spite of my other email thread running in > parallel to this) I am not doing any complex encoding of the data being > streamed to disk - these are just basic TIFF images and metadata. Since you said pre

Re: Prioritize my own app's disk access

2016-07-06 Thread Quincey Morris
On Jul 6, 2016, at 03:06 , Jonathan Taylor wrote: > > a single lost frame will be fairly catastrophic for the scientific experiment If this is genuinely your scenario, then nothing mentioned in this thread is going to satisfy your requirements. It is pure whimsy to expect any prioritization m

Re: Prioritize my own app's disk access

2016-07-06 Thread Alastair Houghton
On 6 Jul 2016, at 11:06, Jonathan Taylor wrote: > > Hopefully my detail above explains why I really do not want to drop frames > and/or use a ring buffer. Effectively I have a buffer pool, but if I exhaust > the buffer pool then (a) something is going badly wrong, and (b) I prefer to > expand

Re: Prioritize my own app's disk access

2016-07-06 Thread Jonathan Taylor
Thanks for your reply Alastair. Definitely interested in thinking about your suggestions - some responses below that will hopefully help clarify: > The first thing to state is that you *can’t* write code of this type with the > attitude that “dropping frames is not an option”. Fundamentally, th

Re: Prioritize my own app's disk access

2016-07-06 Thread Alastair Houghton
On 5 Jul 2016, at 13:36, Jonathan Taylor wrote: > > This is a long shot, but I thought I would ask in case an API exists to do > what I want. One of the roles of my code is to record video to disk as it is > received from a camera. A magnetic hard disk can normally keep up with this, > but if

Re: Prioritize my own app's disk access

2016-07-05 Thread Jens Alfke
> On Jul 5, 2016, at 2:40 PM, Jonathan Taylor > wrote: > > As far as the quality of service goes, I can't see the APIs for that (looking > in the 10.9 SDK, at least). Am I looking in the wrong place? IIRC, QoS was added in 10.10. > I confess that currently I am using pure cocoa -writeToFile:

Re: Prioritize my own app's disk access

2016-07-05 Thread Jonathan Taylor
Thanks everyone for your replies on this second question of mine. Some responses below: On 5 Jul 2016, at 18:20, Quincey Morris wrote: > What worries me about the Darwin-level (i.e. Unix-level) API suggestions that > others have made is that you don’t know how these interact with Cocoa apps.

Re: Prioritize my own app's disk access

2016-07-05 Thread Michael David Crawford
If it's a dedicated workstation, it should be OK to require a RAID 0. That won't affect anyone's priority, but all disk I/O will be divided among two or more disks. Alternatively, dedicate a single drive only to video, with your other drive being for everything else. Michael David Crawford, Barito

Re: Prioritize my own app's disk access

2016-07-05 Thread Quincey Morris
On Jul 5, 2016, at 05:36 , Jonathan Taylor wrote: > > suggestions that might be relevant here What worries me about the Darwin-level (i.e. Unix-level) API suggestions that others have made is that you don’t know how these interact with Cocoa apps. You didn’t actually say whether your app is a

Re: Prioritize my own app's disk access

2016-07-05 Thread Jens Alfke
You might try asking on the darwin-userlevel mailing list. In addition to increasing I/O priority, there may be other ways to make your disk writes more efficient. For example you can preallocate space for the file before writing to it. Writing in larger chunks may also help. (Of course you may

Re: Prioritize my own app's disk access

2016-07-05 Thread Jonathan Taylor
Thanks Alastair. Mark Allan’s email set me off reading things in that area, and I am indeed reading the man page for setiopolicy_np at this very moment! Certainly sounds like the API I am looking for although, as you say, it’s not clear where the “default” policy fits into the hierarchy. The man

Re: Prioritize my own app's disk access

2016-07-05 Thread Alastair Houghton
On 5 Jul 2016, at 13:36, Jonathan Taylor wrote: > > This is a long shot, but I thought I would ask in case an API exists to do > what I want. One of the roles of my code is to record video to disk as it is > received from a camera. A magnetic hard disk can normally keep up with this, > but if

Re: Prioritize my own app's disk access

2016-07-05 Thread Mark Allan
Have you tried to nice/renice your process ID? I know that works for CPU usage but I'm not sure about other hardware resources. A cursory glance at the man pages for getpriority & setpriority seem to indicate that network and disk IO can be lowered in priority so I would try that first to see i

Prioritize my own app's disk access

2016-07-05 Thread Jonathan Taylor
This is a long shot, but I thought I would ask in case an API exists to do what I want. One of the roles of my code is to record video to disk as it is received from a camera. A magnetic hard disk can normally keep up with this, but if the user is also doing other things on the computer (e.g. lo