Thoughts about streaming from disk and VM
Thoughts about streaming from disk and VM
- Subject: Thoughts about streaming from disk and VM
- From: "Eric Huffman" <email@hidden>
- Date: Wed, 12 Mar 2003 13:02:37 -0600
Hello,
The following are some thoughts on streaming audio from disk under Mac
OSX. If anyone would care to comment, it would be greatly appreciated.
The technical issue is that of streaming audio optimally from many
different disk sectors for the purpose of additional processing, a basic
and fundamental technical issue.
Multiple Files (no VM) -
For streaming from multiple files (each being mono or multi-channel
interlaced data) under a non-VM OS, there are of course effective
approaches in which file IO operations can be used with buffers for each
file, with attention given to the implementation such that the access to
the disk is optimized for sequential access (since of course almost all
disks have better sustained transfer rates compared to random access).
Multiple Files (VM) -
Under a VM OS, the above approach for multiple files seems to have
non-optimal runtime behavior since the VM manager has to perform
additional memory management for the buffer memory (e.g. possibly paging
out memory for the allocation of the buffers, possibly paging in the
buffers if they were paged out since the last file IO, and possibly
paging out the buffers after the file IO).
Another approach involves mapping the files into memory (e.g. using
mmap). This avoids most of the mentioned overhead related to the VM
manager and the file buffers. However, this is not optimal for
sequential disk access since the files will be read in page size chunks.
An interesting addition is that of heuristically and occasionally
"pre-warming" the mapped memory by touching the mapped memory in chunks
greater than a page size. This helps in driving sequential access to
the disk at the expense incurred by the "pre-warming" but still does not
guarantee that the memory that will need to be read later will still be
in core memory. Another addition may be to use mincore to determine if
the memory is still in core and performing "re-warming" as needed, but
mincore appears to only have a stub implementation in Darwin.
Any comments are greatly appreciated.
Thanks, Eric
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.