Browse Prior Art Database

Registry Process for Unique Semaphore Names

IP.com Disclosure Number: IPCOM000104948D
Original Publication Date: 1993-Jun-01
Included in the Prior Art Database: 2005-Mar-19
Document File: 2 page(s) / 89K

Publishing Venue

IBM

Related People

Atwater, KM: AUTHOR [+3]

Abstract

A methodology is described which allows a programmer to be assured that a system resource (semaphore, shared memory, etc.) will not be used (created or opened) by another application or by the operating system.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Registry Process for Unique Semaphore Names

      A methodology is described which allows a programmer to be
assured that a system resource (semaphore, shared memory, etc.) will
not be used (created or opened) by another application or by the
operating system.

      A problem application programs (and programmers) have is when
an application program makes use of a system semaphore name in an
operating system and assumes that the name is unique within the
operating system.  If the name chosen for the semaphore is also used
by either the Operating System or another application program, then
hard-to-diagnose failures may occur.

      This invention addresses the problem of assuring that semaphore
names do not conflict between disjoint programs.

      An operating system, for instance IBM's OS/2*, provides for
interprocess communications between multiple programs (processes)
within an application.

      One form of interprocess communications is the 'system
semaphore', which is a named-system resource and can be used to
efficiently coordinate transactions or events between processes (or
threads).  For example, Program A may be responsible for dispatching
work units to Program B. Program B will wait for a unit of work by
waiting on the semaphore (DOSSEMWAIT).  Program A will put some data
into a disk file and then use the semaphore (DOSSEMCLEAR) to signal

Program B that a work unit is ready to be processed.  Program B will
then read the data from the disk file.

      In order for both programs to have access to one specific
semaphore, they must be tied logically to the same semaphore address.
The programmer(s) agree in advance to use a (hopefully) unique
semaphore name in their programs.  Each program performs an operating
system function (DOSOPENSEM), using the agreed-upon name, to gain
access to the address of the semaphore.

      It is expected that one of the programs (usually program A)
will have initially performed an operating system function
(DOSCREATESEM) to create (define) the previously-undefined semaphore
name.  If the semaphore name has already been defined, then the
function (DOSCREATESEM) will fail, indicating that the semaphore
already exists.  The programmer can then provide error
r...