On Fri, 26 Oct 2012 10:03:52 -0500
David Ashley <[email protected]> wrote:
> As long as the creator closes the semaphore everything will be ok -
> the semaphore will be unlinked and removed from the system. The
> creating process is the owner of the semaphore as far as removing it
> from the system.
>
The sem_close man page states:
sem_close() closes the named semaphore referred to by sem,
allowing any resources that the system has allocated to the calling
process for this semaphore to be freed.
sem_unlink man page has:
sem_unlink() removes the named semaphore referred to by name.
The semaphore name is removed immediately. The semaphore is
destroyed once all other processes that have the semaphore open
close it.
That is why I think sem_close does not eventually delete the sempahore
but it should be possible to trigger sem_unlink.
> In reality I believe that the rxapi process actually owns the
> semaphore and when the process ends it should attempt to remove all
> open files/pipes/semaphores/etc. Rick should be able to confirm this.
>
I don't know. Let's see what Rick says.
--
Manfred
On Fri, 2012-10-26 at 16:54 +0200, Manfred Lotz wrote:
> On Fri, 26 Oct 2012 09:20:07 -0500
> David Ashley <[email protected]> wrote:
>
> > On further review we have some other problems as well.
> >
> > The same problems described in Manfred's two emails also are in the
> > event semaphore code.
> >
> > And the documentation for the mutex and event create functions has a
> > major error because it states that the returned handle can be passed
> > to the open function, but the open functions only accept a semaphore
> > name, not a handle.
> >
> > I will open a bug on these problems and try to correct them today.
> >
>
> Thanks David.
>
> In my opinion there is a 3rd problem. Because of the Linux semaphore
> semantics there is a function needed for explicitly deleting a
> semaphore, like for instance SysUnlinkMutexSem() which could then call
> sem_unlink(). Otherwise a semaphore will live happily till the Linux
> system reboots which perhaps isn't always intended.
>
>
> I do not have a clue how this will be handled in Windows.
>
>
> Your thoughts?
>
>
>
------------------------------------------------------------------------------
The Windows 8 Center
In partnership with Sourceforge
Your idea - your app - 30 days. Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel