lkml.org 
[lkml]   [2001]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: semaphores and noatomic flag
    Date
    > -----Original Message-----
    > From: linux-kernel-owner@vger.kernel.org
    > [mailto:linux-kernel-owner@vger.kernel.org]On Behalf Of Mihai Moise
    >
    > up(semaphore 1) /* wake up client */
    > down(semaphore 0) /* put iself to sleep */
    >
    > The problem is that the two system calls make the whole process twice
    > as slow as it needs to be, and they are both needed because the semop
    > system call is implemented in an atomic manner. If the semop system
    > call had an IPC_NOATOMIC flag, then the each process would only have
    > to do one call,
    >
    > semop(up semaphore 0 & down semaphore 1, IPC_NOATOMIC)
    >
    > which would be interpreted in the kernel as the sequence of two
    > system calls I have written previously.

    On Tuesday 05 June 2001 08:28, Anil Kumar wrote:
    > Will it not be a very specialized case rather than being general call
    > type?

    The concept is general and useful, though I don't think its expression
    here is correct. A similar feature used in dynix was described earlier
    in some detail by Paul Cassella:

    http://marc.theaimsgroup.com/?l=linux-kernel&m=97742705300697&w=2
    (Re: [RFC] Semaphores used for daemon wakeup)

    The idea is to atomically release one serializer and grab another. We
    have quite a few flavors of lock so square that and you have the number
    of primitives you'd need for a complete set.

    To sell the idea you'd have to come up with a few places where the new
    primitives would make the kernel run better, then you'd have to
    implement it or find someone with the necessary scheduler hacking
    skills to do it for you. The last part is the tricky one. ;-)

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

    \
     
     \ /
      Last update: 2005-03-22 12:54    [W:0.044 / U:60.568 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site