msleep stays, but after mset; caveat about mixed use
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Tue, 13 May 1986 01:51:27 +0000 (17:51 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Tue, 13 May 1986 01:51:27 +0000 (17:51 -0800)
SCCS-vsn: share/doc/psd/05.sysman/1.2.t 6.6
SCCS-vsn: share/doc/psd/05.sysman/a.t 6.5

usr/src/share/doc/psd/05.sysman/1.2.t
usr/src/share/doc/psd/05.sysman/a.t

index f9c54a8..e031213 100644 (file)
@@ -2,7 +2,7 @@
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
-.\"    @(#)1.2.t       6.5 (Berkeley) %G%
+.\"    @(#)1.2.t       6.6 (Berkeley) %G%
 .\"
 .sh "Memory management\(dg
 .NH 3
 .\"
 .sh "Memory management\(dg
 .NH 3
@@ -118,6 +118,8 @@ will be flushed;
 if \fIlen\fP is non-zero, only the pages containing \fIaddr\fP and \fIlen\fP
 succeeding locations will be examined.
 Any required invalidation of memory caches will also take place at this time.
 if \fIlen\fP is non-zero, only the pages containing \fIaddr\fP and \fIlen\fP
 succeeding locations will be examined.
 Any required invalidation of memory caches will also take place at this time.
+Filesystem operations on a file which is mapped for shared modifications
+are unpredictable except after an \fImsync\fP.
 .PP
 A mapping can be removed by the call
 .DS
 .PP
 A mapping can be removed by the call
 .DS
@@ -148,7 +150,7 @@ madvise(addr, len, behav);
 caddr_t addr; int len, behav;
 .DE
 \fIBehav\fP describes expected behavior, as given
 caddr_t addr; int len, behav;
 .DE
 \fIBehav\fP describes expected behavior, as given
-in <mman.h>:
+in \fI<sys/mman.h>\fP:
 .DS
 ._d
 #define        MADV_NORMAL     0       /* no further special treatment */
 .DS
 ._d
 #define        MADV_NORMAL     0       /* no further special treatment */
@@ -169,37 +171,10 @@ that the page is in-core.
 .NH 3
 Synchronization primitives
 .PP
 .NH 3
 Synchronization primitives
 .PP
-.if \n(sw=0 .ig sw
-Two routines provide services analogous to the kernel
-\fIsleep\fP and \fIwakeup\fP functions interpreted in the domain of
-shared memory.
-A process may relinquish the processor by calling \fImsleep\fP:
-.DS
-msleep(sem)
-semaphore *sem;
-.DE
-\fISem\fP must lie within a MAP_SHARED region with at least modes
-PROT_READ and PROT_WRITE.
-The MAP_HASSEMAPHORE flag must have been specified when the region was created.
-The process will remain in a sleeping state
-until some other process issues an \fImwakeup\fP for the same semaphore
-within the region using the call:
-.DS
-mwakeup(sem)
-semaphore *sem;
-.DE
-An \fImwakeup\fP may awaken all sleepers on the semaphore,
-or may awaken only the next sleeper on a queue.
-.PP
-To avoid system calls for the usual case of an uncontested lock,
-routines are provided to acquire and release locks.
-.sw
-.if \n(sw .ig sw
 Primitives are provided for synchronization using semaphores in shared memory.
 Semaphores must lie within a MAP_SHARED region with at least modes
 PROT_READ and PROT_WRITE.
 The MAP_HASSEMAPHORE flag must have been specified when the region was created.
 Primitives are provided for synchronization using semaphores in shared memory.
 Semaphores must lie within a MAP_SHARED region with at least modes
 PROT_READ and PROT_WRITE.
 The MAP_HASSEMAPHORE flag must have been specified when the region was created.
-.sw
 To acquire a lock a process calls:
 .DS
 value = mset(sem, wait)
 To acquire a lock a process calls:
 .DS
 value = mset(sem, wait)
@@ -225,3 +200,22 @@ If the ``want'' flag is zero in the previous value,
 \fImclear\fP returns immediately.
 If the ``want'' flag is non-zero in the previous value,
 \fImclear\fP arranges for waiting processes to retry before returning.
 \fImclear\fP returns immediately.
 If the ``want'' flag is non-zero in the previous value,
 \fImclear\fP arranges for waiting processes to retry before returning.
+.PP
+Two routines provide services analogous to the kernel
+\fIsleep\fP and \fIwakeup\fP functions interpreted in the domain of
+shared memory.
+A process may relinquish the processor by calling \fImsleep\fP:
+.DS
+msleep(sem)
+semaphore *sem;
+.DE
+The process will remain in a sleeping state
+until some other process issues an \fImwakeup\fP for the same semaphore
+within the region using the call:
+.DS
+mwakeup(sem)
+semaphore *sem;
+.DE
+An \fImwakeup\fP may awaken all sleepers on the semaphore,
+or may awaken only the next sleeper on a queue.
+.PP
index 5ea43c8..b16d43d 100644 (file)
@@ -2,7 +2,7 @@
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
-.\"    @(#)a.t 6.4 (Berkeley) %G%
+.\"    @(#)a.t 6.5 (Berkeley) %G%
 .\"
 .ds RH Summary of facilities
 .bp
 .\"
 .ds RH Summary of facilities
 .bp
@@ -60,8 +60,8 @@ munmap\(dg    unmap memory
 mprotect\(dg   change protection of pages
 madvise\(dg    give memory management advice
 mincore\(dg    determine core residency of pages
 mprotect\(dg   change protection of pages
 madvise\(dg    give memory management advice
 mincore\(dg    determine core residency of pages
-.\"msleep\(dg  sleep on a lock
-.\"mwakeup\(dg wakeup process sleeping on a lock
+msleep\(dg     sleep on a lock
+mwakeup\(dg    wakeup process sleeping on a lock
 .TE
 .in -5
 .h 1.3 "Signals
 .TE
 .in -5
 .h 1.3 "Signals
@@ -203,13 +203,6 @@ setsockopt set socket option
 .in -5
 .h 2.4 "Terminals, block and character devices
 .in +5
 .in -5
 .h 2.4 "Terminals, block and character devices
 .in +5
-.TS
-lw(1.6i) aw(3i).
-.TE
 .in -5
 .h 2.5 "Processes and kernel hooks
 .in -5
 .h 2.5 "Processes and kernel hooks
-.in +5
-.TS
-lw(1.6i) aw(3i).
-.TE
 .in -5
 .in -5