Re: [coreaudio] Wired Memory Utilities
Re: [coreaudio] Wired Memory Utilities
- Subject: Re: [coreaudio] Wired Memory Utilities
- From: robert <email@hidden>
- Date: Mon, 11 Mar 2002 09:11:46 +0100
- Mail-followup-to: email@hidden
>
mlock/munlock are POSIX memory mapping calls that do about the same
>
thing. They end up call vm_wire, but they do some sanity checks first.
>
One of the sanity checks in mlock appears to limit the total amount of
>
memory that can be wired in the system. If returns EAGAIN if this is
>
hit.
True. I'm not sure about Darwin (never tested it, but its manual page says
it's supported), but on FreeBSD you can set this limit with the setrlimit()
systemcall, using the RLIMIT_MEMLOCK flag.
Ofcourse, both mlock() and setrlimit() (for raising a limit) require
superuser privileges.
>
At any rate, mlock and munlock to appear to be the best choice for wiring
>
memory and they appear to work.
It sure is the most portable way. Thanks for the code, I find it very
useful when people share their findings :)
However, let me ask you a question: do you really want to lock your
process' memory pages in physical memory? I understand what you're trying
to do (providing your application with the lowest possible latency, defying
any potential problems the VM system might impose), but are you actually in
need of this sort of (forgive my harsh terminology :) un-Unix methods?
robert
_______________________________________________
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.