| 2 Dec 2025 |
WeetHet | Is there an alternative to sysv shared memory on macOS? | 19:32:30 |
WeetHet | There's POSIX but it's much more limited | 19:32:47 |
WeetHet | And postgres is using SysV on Linux as well | 19:33:02 |
Randy Eckenrode | The reply in the linked issue suggested Darwin futexes. | 19:33:23 |
Randy Eckenrode | * | 19:33:31 |
Randy Eckenrode |
The next problem will be System V semaphores. I posted a patch[4] that uses macOS futexes to implement semaphores (pretty much the same way libc does on some other systems), which would fix that version of the problem. But you could presumably already use the more wasteful
named POSIX semaphores.
| 19:34:15 |
Randy Eckenrode | https://www.postgresql.org/message-id/flat/CA+hUKGKRQrJhVYBkmLJZsScJ434qiduWzzpB0-0_FW8z1kTjcw@mail.gmail.com#19f7d84d058a908865bafbf82233a07f | 19:34:40 |
WeetHet | For semaphores sure but semaphores aren't the biggest problem here | 19:34:44 |
WeetHet | Shared memory is | 19:34:48 |
Randy Eckenrode | The issue is what they’re using it for, isn’t it? | 19:35:09 |
Randy Eckenrode | Futexes can be shared between processes. The MSYNC patch for Wine did something similar. | 19:35:33 |
WeetHet | https://github.com/postgres/postgres/blob/master/src/backend/port/sysv_shmem.c | 19:35:50 |
Randy Eckenrode | https://github.com/marzent/wine-msync | 19:36:16 |
WeetHet | I'm surprised that only postgres is running into these issues | 19:38:50 |
WeetHet | I would expect most databases to use shared memory in one way or another | 19:39:04 |