On Mon, Apr 11, 2005 at 04:28:25PM -0700, Perez-Gonzalez, Inaky wrote: > >From: Bill Huey (hui) [mailto:[EMAIL PROTECTED] ... > API than once upon a time was made multithreaded by just adding > a bunch of pthread_mutex_[un]lock() at the API entry point... > without realizing that some of the top level API calls also > called other top level API calls, so they'd deadlock.
Oh crap. > Quick fix: the usual. Enable deadlock detection and if it > returns deadlock, assume it is locked already and proceed (or > do a recursive mutex, or a trylock). You have to be joking me ? geez. ... > It is certainly something to explore, but I'd better drive your > way than do it. It's cleaner. Hides implementation details. > > I agree, but it doesn't work that well when talking about legacy > systems...that's the problem. Yeah, ok, I understand what's going on now. There isn't a notion of projecting priority across into the Unix/Linux kernel traditionally which is why it seemed so bizarre. > Sure--and because most was for legacy reasons that adhered to > POSIX strictly, it was very simple: we need POSIX this, that and > that (PI, proper adherence to scheduler policy wake up/rt-behaviour, > deadlock detection, etc). Some of this stuff sounds like recursive locking. Would this be a better expression to solve the "top level API locking" problem you're referring to ? > Fortunately in those areas POSIX is not too gray; code to the book. > Deal. I would think that there will have to be a graph discontinuity between user/kernel spaces at kernel entry and exit for the deadlock detector. Can't say about issues at fork time, but I would expect that those objects would have to be destroyed when the process exits. The current RT (Ingo's) lock isn't recursive nor is the deadlock detector the last time I looked. Do think that this is a problem for legacy apps if it gets overload for being the userspace futex as well ? (assuming I'm understanding all of this correctly) > Of course, selling it to the lkml is another story. I would think that pushing as much of this into userspace would make the kernel hooks for it more acceptable. Don't know. /me thinks more bill - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/