Re: preemtive or non-prempteve ?

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

 



On Fri, Aug 05, 2005 at 19:35:14 +0100, Tristan Wibberley wrote:
> I wrote:
> 
> > There is also Ingo Molnar's (and probably others') RT-PREEMPT patches
> > currenty under development. These really do try to get nearly every
> > point preemtible. Drivers should synchronise with semaphores, mutexes
> > (which both do priority inheritance), and completions.
> 
> I think that's a bit wrong. It doesn't make sense for a semaphore to do
> priority inheritance as the whole point of a semaphore is that things
> are supposed to receive notification when something has finished, and
> the thing that does the notifying does not try to make progress for the
> waiters. While a mutex identifies a critical section and the
> process/thread holding the mutex moves out of the way quickly when a
> high priority thread/process is waiting (essentially starts making rapid
> progress for the benefit of the waiter, since the waiter has important
> things to do).

In kernel there is NO PRIMITIVE CALLED MUTEX. It is a special case of
semaphore. Thus it is the semaphore that has to do priority inheritance.

There are also spin-locks, which are conceptually mutexes, but they
are special in that they disable preemption -- the real-time patches
need to reduce the span of these.

Notifications when something is finished are usually sent using
wait-queues (which are "conditional variables") and completions (which
are rather similar to semaphores).

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@xxxxxx>

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux