Re: ROC's Proposal for fixing race conditions

On Aug 8, 2013, at 11:29 PM, Robert O'Callahan <robert@ocallahan.org> wrote:

> On Fri, Aug 9, 2013 at 5:53 PM, Jer Noble <jer.noble@apple.com> wrote:
> It seems as though your proposal could be implemented on any platform with support for copy-on-write page semantics, without requiring neutering any outstanding ArrayBuffers.  E.g., on Posix platforms, the "acquire the contents" step could simply mmap(MAP_PRIVATE) the source memory, and if the original memory contents are modified, the AudioBuffer gets a fresh copy.
> 
> I considered trying to use mmap to create copy-on-write snapshots of memory blocks but couldn't figure out how to get it to work on Linux or Windows. Can you be specific about exactly how this would work?

I'm not an expert on either, but this is how you'd get it to work on Mach kernels:

https://gist.github.com/jernoble/6196382

-Jer

Received on Friday, 9 August 2013 19:21:41 UTC