Re: [QUESTION] How to use interruptible_sleep_on() without races ?

Jean Tourrilhes (jt@bougret.hpl.hp.com)
Thu, 4 Apr 2002 19:08:48 -0800


On Fri, Apr 05, 2002 at 04:20:04AM +0100, Alan Cox wrote:
> >
> > I looked at it in every possible way, and I don't see how it
> > is possible to use safely interruptible_sleep_on(). And I wonder :
>
> It isnt for interrupt stuff - its going back to the old kernel behaviour
> when it used to be usable

So, maybe it would be a nice idea to remove it from the 2.5.X
kernel to force a "spring cleanup" of the old code. If it's no longer
usable and only confusing, it should be purged...

> Actually the code it uses is clean, slightly verbose but clean. It puts
> the phases in the right order and that fixes the race cleanly. You
> could just use completions in that case or you could use
>
> wait_event_interruptible(&my_wait_queue, my_condition==FALSE)
>
> which is a macro that generates the right stuff.

And it might even want to be defined in include/linux/sched.h
as a replacement for interruptible_sleep_on(). It seems like a generic
need, and I would feel much safer if one of the guru wrote it properly
for me ;-)

> Alan

Regards,

Jean
-
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/