* Valdis Kletnieks writes: > On Mon, 26 Jan 2004 15:06:48 +1000, Steve Youngs said: >> > A boolean is just a one-bit reference count. If the maximum number of >> > simultaneous 'users' for a given module is one, then a boolean will work. >> > If there is potential for more than one simultaneous user then you need >> > more bits. >> >> Why? A module is either being used or it isn't, the number of uses >> shouldn't even come into it. > OK. There's 2 users of the module. The first one exits. How does > it (or anything else) know that it's NOT safe to just clear the > in-use bit and clean it up? Because the 2nd user is still using the module so its in-use bit should still be set. Remember that when the module was first loaded it registered a function with the kernel for testing whether the module is in use. I must be overlooking something because I see the answer so clearly. Maybe if someone could give me a real world example of a situation where it'd be hard/impossible/unsafe to unload a module and I'll see if my ideas can be applied. -- |---------------------| | Ashes to ashes, dust to dust. | | The proof of the pudding, is under the crust. | |---------------------------------|