Re: QUERY regarding semaphores?

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

 



On 12/21/05, pradeep singh <2500.pradeep@xxxxxxxxx> wrote:
>
>
> On 12/21/05, Badari Prasad <h.badari@xxxxxxxxx> wrote:
> > Hello,
> >          I have a Query regarding semaphores, is semaphores a mandatory
> lock mechanism ( like lockf() ) ,or an advisory lock mechanism ( like flock
> () ).
>
>  it  is a mandatory lock mechanishm , where the requesting process checks
> for a  value  to get  positive ( as semaphores r initalised to a value
> depending on usage ...AFAIR ..plz CMIIW) , there r generally 2 operations on
> them.
>

[Please:  s/r/are/ ,  s/plz/please/]

You are wrong. Kernel semaphores are, as Matthew Wilcox already
answered, advisory locks.
Nothing at all is stopping you from accessing data protected by a
semaphore - bad things will probably happen but nothing stops you from
crashing your kernel that way.


>  sem wait and sem post.
>  check any book on linux prograaming on their implementation....
>
>  good luck
>
>
> >           If it is an advisory lock mechanism, in which situation the lock
> be ignored by the other process ( say process2 ) trying to access the data
> which is locked by process1.
> >
> > Thank you,
> >          Badari.
> >


--
Jesper Juhl <jesper.juhl@xxxxxxxxx>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[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