Re: ROC's Proposal for fixing race conditions

On Aug 9, 2013, at 2:33 PM, Robert O'Callahan <robert@ocallahan.org> wrote:

> On Sat, Aug 10, 2013 at 7:21 AM, Jer Noble <jer.noble@apple.com> wrote:
> 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
> 
> As far as I know, Linux and Windows have no equivalent of mach_make_memory_entry. I had even tried mmaping /proc/self/mem on Linux as a dastardly hack, but it didn't work :-).

Well, the equivalent would be shm_open(), then mmap'ing the resulting file descriptor. I just don't think you can MAP_PRIVATE from a shared memory object.  :-(

It looks like there's a similar mechanism for Windows, where you CreateFileMapping() to create a named object, which can then be mapped as copy-on-write with MapViewOfFile().  I haven't tested this either.

-Jer

Received on Friday, 9 August 2013 21:42:42 UTC