I dare to disagree. It makes for more messy code in general and might
result in the obvious bugs to be replaced by subtle ones that are far
harder to debug.
> I would argue that the latter is undoubtedly true - merely that
> userspace flock/fcntl works that way would argue for it, but there
> are a couple of other reasons too.
No ;-) Only fcntl does.
> Going against is the point that it may be slower. Can you dig out your
> implementation and show me it? I wasn't going for assembler in my hasty
It's also a waste of memory. There are many structures that have a lock
per instance and four extra bytes (for the owner) would be noticeable.
Not that memory is so precious resource, but cachelines may be.
> example. I just wanted to establish that it's easy, so that it becomes
> known that its easy, and folks therefore aren't afraid of it. That both
> you and I have had to write it implies that it's not obvious code to
> everyone.
It's not about weather it's easy. It's about weather it's useful.
-------------------------------------------------------------------------------
Jan 'Bulb' Hudec <bulb@ucw.cz>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/