Re: semaphore ownership

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

 





On Sat, Mar 21, 2009 at 12:24 AM, Daniel Baluta <daniel.baluta@xxxxxxxxx> wrote:
On Fri, Mar 20, 2009 at 8:30 PM, Shyam Burkule <shyam.burkule@xxxxxxxxx> wrote:
> Hello All,
>
>           Is it possible to take semaphore in one thread and release it in
> another thread?
>
> Thanks
> Shyam
>

Hello ,

Of course it is possible as long as you have a reference to the semaphore.

But be aware that the usage of semaphores is advisory , and it depends
on you to implement a good functionality.

thanks,
Daniel.


Hi Daniel,
Thanks for reaply..

        Actually I was reading about synchronization mechanism in Linux ans Windows. So same case is applicable to mutex as well. I mean it possible to take mutex one thread and release it in another thread. But in Windows there is mutex ownership concept, meaning thread which takes mutex has to release it. So if some thread release mutex, which is held by another thread then there wont be mutual exclusive access to shared data  protected by mutex in that thread.


Sorry for silly question :).


Thanks
Shyam
   


Thanks
    Shyam

[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