sleep.9 (1ddb20703dc9ab1210aa9b11016044184b6ba0cb) | sleep.9 (a04dd7481b80786760f38ff3902e24851fc7ef37) |
---|---|
1.\" 2.\" Copyright (c) 1996 Joerg Wunsch 3.\" 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: --- 9 unchanged lines hidden (view full) --- 18.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25.\" | 1.\" 2.\" Copyright (c) 1996 Joerg Wunsch 3.\" 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: --- 9 unchanged lines hidden (view full) --- 18.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25.\" |
26.\" $Id: sleep.9,v 1.12 1998/12/21 10:34:53 dillon Exp $ | 26.\" $Id: sleep.9,v 1.13 1998/12/23 00:24:59 dillon Exp $ |
27.\" " 28.Dd December 17, 1998 29.Os 30.Dt SLEEP 9 31.Sh NAME 32.Nm sleep , 33.Nm tsleep , 34.Nm asleep , --- 156 unchanged lines hidden (view full) --- 191better use of spinlocks. A spinlock, by its very nature, cannot be used 192around code that might block. It is hoped that these capabilities will 193make it easier to migrate the SMP master locks deeper into the kernel. 194.Pp 195These routines may also be used to avoid nasty spl*() calls to get around 196race conditions with simple conditional test/wait interlocks. You simple 197call 198.Fn asleep | 27.\" " 28.Dd December 17, 1998 29.Os 30.Dt SLEEP 9 31.Sh NAME 32.Nm sleep , 33.Nm tsleep , 34.Nm asleep , --- 156 unchanged lines hidden (view full) --- 191better use of spinlocks. A spinlock, by its very nature, cannot be used 192around code that might block. It is hoped that these capabilities will 193make it easier to migrate the SMP master locks deeper into the kernel. 194.Pp 195These routines may also be used to avoid nasty spl*() calls to get around 196race conditions with simple conditional test/wait interlocks. You simple 197call 198.Fn asleep |
199prior to your test, then conditonally | 199prior to your test, then conditionally |
200.Fn await 201only if the test fails. It is usually a good idea to cancel an 202.Fn asleep 203if you wind up never calling the related 204.Fn await , 205but it is not required. If you do not want to waste cpu calling 206.Fn asleep 207unnecessarily, you can surround the whole thing with a second test. The --- 24 unchanged lines hidden --- | 200.Fn await 201only if the test fails. It is usually a good idea to cancel an 202.Fn asleep 203if you wind up never calling the related 204.Fn await , 205but it is not required. If you do not want to waste cpu calling 206.Fn asleep 207unnecessarily, you can surround the whole thing with a second test. The --- 24 unchanged lines hidden --- |