Wait, would reading back over the mapping create a copy of the page?
Even if the contents are identical, it would still be the write of a
copy-on-write, I am guessing. I can write into a separate buffer and
copy it into the mapping only if there is a mismatch, or I can use a
periodic fork. That's still not a huge problem. Just need to figure
out what configuration will work. I don't have any plans to deploy it
on OpenBSD yet, but I like to develop on random environments in case I
run into assumptions, like a coherent mmap.

On Fri, Apr 15, 2016 at 12:09 PM, Ted Unangst <[email protected]> wrote:
> Ben Woolley wrote:
>> Do the updates of the mmap happen in the order that writes are made?
>> If so, I could at least tell when coherence was reached.
>>
>> But it isn't a huge deal. The main purpose was to be able to share
>> memory between workers, and I can just do a read() into the shared
>> memory to make the memory coherent.
>
> I'm not sure it's possible to predict when a write() will become visible
> via mmap(). If feasible, I would try doing the write via mmap as well.
>
> Or as you say, if you only need shared memory, read() back into it would work.

Reply via email to