Comments on Section 7.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This started out as a longer email, but it looks like at least two of
the problems I spotted were already fixed in the latest version.

1. I think the recommendation to release all locks before invoking a
user-supplied function should come with a BIG FLASHING WARNING SIGN
(or the PDF equivalent). Whenever I review code that releases and
re-acquires a lock I look for the faulty assumptions it makes about
state being preserved from before the lock was released. 9 out of 10
times I find a bug.

2. qsort() may not be the best example to use in this section, as,
even assuming there is some version of it that requires locks, the
reader may fail to see any problems. While I'm no fan of nftw(), it
may be easier to see why you would need a lock in the library (to
prevent changes to the directory), as well as why releasing and
re-acquiring the lock can be dangerous (the iterator can become
invalid).

3. Page 106, first paragraph: "an pointer" should be "a pointer".

--Elad



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux