Browse Prior Art Database

X and S Latch Using DOS Semaphores (S-Priority) and Other Serialization Considerations in the OS/2 Environment

IP.com Disclosure Number: IPCOM000035992D
Original Publication Date: 1989-Aug-01
Included in the Prior Art Database: 2005-Jan-28
Document File: 2 page(s) / 19K

Publishing Venue

IBM

Related People

Arnold, HH: AUTHOR [+2]

Abstract

A method is described to provide an S and X-latch function with S- latch priority using OS/2* Standard Edition semaphores. The method addresses the common multiprocessing problem of serializing updates and waiting for either availability of resources or for work to do. Although OS/2 allows the usage of a single semaphore for both serialization and wait/post operations, usage of a single semaphore for both of these purposes causes intermittent hangs.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 100% of the total text.

Page 1 of 2

X and S Latch Using DOS Semaphores (S-Priority) and Other Serialization Considerations in the OS/2 Environment

A method is described to provide an S and X-latch function with S- latch priority using OS/2* Standard Edition semaphores. The method addresses the common multiprocessing problem of serializing updates and waiting for either availability of resources or for work to do. Although OS/2 allows the usage of a single semaphore for both serialization and wait/post operations, usage of a single semaphore for both of these purposes causes intermittent hangs.

The solution to the above problem is to use two OS/2 semaphores and a flag or status area. The first semaphore is used for serialization, and the second is used for wait/post operations. This construct is used in OS/2 Database Manager to implement not only the S/X latches, but also a wait/post structure. The latch area format is shown below:

[[[[

S1 Access semaphore

S2 Wait/Post semaphore

C Counter

[[[[

Latch function ( ptr semaphore area, option )

DOS SEM REQUEST S1

if (option .eq. S)

C = C + 1

DOS SEM CLEAR S1

else

while ( C > 0 )

DOS SEM CLEAR S1

DOS SEM SET WAIT S2

DOS SEM REQUEST S1

endwhile

endif

unlatch function ( ptr semaphore )

if ( C > 0 ):

DOS SEM REQUEST S1

C = C-1

endif

if ( C == 0 )

DOS SEM CLEAR S2

endif

DOS SEM CLEAR S1 * Trademark of IBM Corp.

1

Page 2 of 2

2

[This page contains 1 picture or other non-text object]