Attached another test program. I don't expect it to print any errors with any OS, but I'd like to confirm it for non-Linux SMP kernels.
(Except for OpenBSD, it doesn't work correctly in it anyway because it doesn't support mixing write()s and mmap())
Mac OS X for Intel 10.4.9: SMP (Core Duo)
$ ./concurrency writing, page size = 4096 0: reading, page size = 4096 open(): No such file or directory 4: reading, page size = 4096 3: reading, page size = 4096 1: reading, page size = 4096 $ 2: reading, page size = 4096 open(): No such file or directory open(): No such file or directory open(): No such file or directory open(): No such file or directory
With all of the reader processes dying almost immediately.
Mac OS X for PowerPC 10.4.9: non-SMP (G4)
$ ./concurrency writing, page size = 4096 4: reading, page size = 4096 3: reading, page size = 4096 2: reading, page size = 4096 1: reading, page size = 4096 0: reading, page size = 4096 open(): No such file or directory
With one reader process dying after about two minutes. Nothing else
after another 20 minutes.
-jim