Messages in this thread | | | Date | Fri, 14 Nov 2008 21:21:02 +0000 | From | Alan Cox <> | Subject | Re: Active waiting with yield() |
| |
> If I have a race condition that gets triggered just for one user in the > world when repeatedly loading & unloading a driver for an hour, and I use > yield() to solve it, what's wrong with it? A wait queue increases cache > footprint for every user. (even if I use preallocated hashed wait queue, > it still eats a cacheline to access it and find out that it's empty)
Reread what I wrote.
You don't need to use a hashed queue, you don't need to even reference the queue in the normal case. You cost is one variable, which you can probably sensibly locate, and a predicted jump.
For that you get proper sleeping behaviour, CPU used by other tasks or guests and you don't hang on hard real time tasks.
| |