mutex.9 (a280550abf7f97914cd92e86e0e698b51c48a46c) mutex.9 (49fe354a54af7a3d063fb2a00bdc49ad5bb29e0e)
1.\"
2.\" Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 114 unchanged lines hidden (view full) ---

123the possible context switch introduced by acquiring a mutex is guaranteed
124to not break anything that is not already broken.
125.Pp
126Mutexes which do not context switch are
127.Dv MTX_SPIN
128mutexes.
129These should only be used to protect data shared with primary interrupt
130code.
1.\"
2.\" Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 114 unchanged lines hidden (view full) ---

123the possible context switch introduced by acquiring a mutex is guaranteed
124to not break anything that is not already broken.
125.Pp
126Mutexes which do not context switch are
127.Dv MTX_SPIN
128mutexes.
129These should only be used to protect data shared with primary interrupt
130code.
131This includes
132.Dv INTR_FAST
133interrupt handlers and low level scheduling code.
131This includes interrupt filters and low level scheduling code.
134In all architectures both acquiring and releasing of a
135uncontested spin mutex is more expensive than the same operation
136on a non-spin mutex.
137In order to protect an interrupt service routine from blocking
138against itself all interrupts are either blocked or deferred on a processor
139while holding a spin lock.
140It is permissible to hold multiple spin mutexes.
141.Pp

--- 384 unchanged lines hidden ---
132In all architectures both acquiring and releasing of a
133uncontested spin mutex is more expensive than the same operation
134on a non-spin mutex.
135In order to protect an interrupt service routine from blocking
136against itself all interrupts are either blocked or deferred on a processor
137while holding a spin lock.
138It is permissible to hold multiple spin mutexes.
139.Pp

--- 384 unchanged lines hidden ---