Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Data Structure Scheme to Support Emulation of UNIX Semaphores in the OS/2 Operating System

IP.com Disclosure Number: IPCOM000110903D
Original Publication Date: 1994-Jan-01
Included in the Prior Art Database: 2005-Mar-26
Document File: 2 page(s) / 84K

Publishing Venue

IBM

Related People

Hidaldo, DS: AUTHOR [+3]

Abstract

Disclosed is an invention which provides a data structure scheme that can be used to support the design of algorithms for very close emulation of UNIX* semaphore system calls in OS/2**. The emulation of UNIX system calls is an accepted approach to porting UNIX C source code to OS/2. The differences in semaphore semantics between these two operating systems makes the emulation of UNIX semaphore system calls particularly challenging.

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

Data Structure Scheme to Support Emulation of UNIX Semaphores in
the OS/2 Operating System

      Disclosed is an invention which provides a data structure
scheme that can be used to support the design of algorithms for very
close emulation of UNIX* semaphore system calls in OS/2**.  The
emulation of UNIX system calls is an accepted approach to porting
UNIX C source code to OS/2.  The differences in semaphore semantics
between these two operating systems makes the emulation of UNIX
semaphore system calls particularly challenging.

      An approach used to port program code written for UNIX
platforms to other operating systems, such as OS/2, is to emulate the
UNIX system calls in those operating systems, along with all the
necessary semantics of those calls and the necessary header file
definitions expected by the ported source code.  Some UNIX system
calls are easier to emulate in OS/2 than others.  Of particular
interest are the emulation of the UNIX semaphore system calls.  UNIX
semaphore system calls have significantly different semantics from
those of OS/2 semaphores.  There is no direct correspondence between
any type of OS/2 semaphore and a UNIX semaphore.

      This invention provides a data structure scheme that can be
used to design algorithms for very close emulation of UNIX semaphore
system calls in OS/2.  The scheme is based on the idea of
representing a single UNIX semaphore and a set of UNIX semaphores by
the structure definitions shown below.

      The UNIX semaphore internal representation in OS/2 emulation is
shown below in C language syntax.

     struct dcecpp_sem

     {

       int  semval;  /* Semaphore value.                           */

       int  sempid;  /* ID of last thread to manipulate

                        the semaphore.                             */

       int  semncnt; /* Number of threads waiting for semaphore

                        to increase.                               */

       int  semzcnt; /* Number of threads waiting for semaphore

                        to become zero.                            */

      HEV  nsem;    /* Increased semaphore value event semaphore.  */

       HEV  zsem;    /* Zero semaphore value event semaphore.      */

     };

      The UNIX Semaphore Set internal representation in OS/2
emulation is shown below in C language syntax.

     struct dcecpp_semset

     {

        HMTX                setlatch;/* Latch to seriali...