Date: Fri, 25 Feb 2005 19:10:51 +0000 (UTC) From: Robert Watson <rwatson@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern uipc_sem.c Message-ID: <200502251910.j1PJAp2d001199@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
rwatson 2005-02-25 19:10:51 UTC FreeBSD src repository Modified files: sys/kern uipc_sem.c Log: Add an exit hook, sem_forkhook(), which walks the list of POSIX semaphores owned by a process when it forks, and creates a matching set of references for the child process, as prescribed by POSIX. In order to avoid races with other threads in the parent process during fork(), it is necessary to allocate a temporary reference list while holding the sem_lock, then transfer those references to the new process once the sem_lock is released. The implementation is inefficient but appears functional; in order to improve the efficiency, it will be necessary to modify the existing structures and logic, which generally rely on O(n) operations over the global set of semaphores. Revision Changes Path 1.16 +113 -1 src/sys/kern/uipc_sem.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502251910.j1PJAp2d001199>