A code I'm porting to Cygwin requires tuning the size of the shareable memory segment to obtain optimal performance. I am using cygserver to access IPC utilities.
cygserver.conf doesn't allow one to set the maximum shareable segment size, SHMMAX directly. Instead, it seems SHMMAX is set in this code fragment in function shminit in cygserver: int i; TUNABLE_INT_FETCH("kern.ipc.shmmaxpgs", &shminfo.shmall); for (i = PAGE_SIZE; i > 0; i--) { shminfo.shmmax = shminfo.shmall * PAGE_SIZE; if (shminfo.shmmax >= shminfo.shmall) break; } Thus, SHMMAX = SHMMAXPGS*PAGE_SIZE , in which SHMMAXPGS is configurable in cygserver.conf, and PAGE_SIZE is the system's page size. So, this suggests that if you have to set SHMMAXPGS in order to set SHMMAX. Is this correct? Further comment: Uncovering this information was somewhat painful. I searched the high and low through the cygwin mailing list archives and google, but couldn't find documentation anywhere on how to set SHMMAX. Since I suspect there are others who might be interested in setting SHMMAX, may I suggest documenting the procedure by adding some lines to cygserver.conf? I volunteer to upgrade and deliver the unit. Of course, this assumes that the procedure has not actually been documented. Gene C. Ruzicka -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/