Re: [PATCH 1/12]: MUTEX: Implement mutexes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 17 Dec 2005, Nicolas Pitre wrote:

>
> Now if you don't disable interrupts then nothing prevents an interrupt
> handler, or another thread if kernel preemption is allowed, to come
> along right between (2) and (4) to call up() or down() which will
> make the sem count inconsistent as soon as the interrupted down() or
> up() is resumed.
>

Well, the one thing that is preventing this is the fact that interrupts
don't call up and down, since down can schedule.  Now they might do a
down_trylock, but then if it would succeed, it would most likely call the
up. So the semaphore would be back to what it was before the interrupt
took place.

But you do have a case about preemption.

-- Steve

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux