Re: MOD_INC_USE_COUNT

Andreas Schwab (schwab@issan.informatik.uni-dortmund.de)
10 Nov 1997 12:32:04 +0100


Regis Duchesne <regis@via.ecp.fr> writes:

|>> |> During this non-atomic operation, before the increment occurs, we
|>> |> have a context switch (is this possible when we are in kernel code?)
|>> No.
|> Then, why are both MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT needed in
|> functions like read_super() :

|> ... read_super(...) {
|> MOD_INC_USE_COUNT;
|> ...
|> MOD_DEC_USE_COUNT;
|> }

|> , since nothing else can happen while the function is executed?

Because the code between them may sleep, eg when reading from disk.

-- 
Andreas Schwab                                      "And now for something
schwab@issan.informatik.uni-dortmund.de              completely different"
schwab@gnu.org