Browse Prior Art Database

Event Control Block Wait and Post Semantics for Distributed Computing Environment / POSIX Threads

IP.com Disclosure Number: IPCOM000117854D
Original Publication Date: 1996-Jun-01
Included in the Prior Art Database: 2005-Mar-31
Document File: 6 page(s) / 155K

Publishing Venue

IBM

Related People

Hahn, TJ: AUTHOR

Abstract

Disclosed is an implementation of the semantics of an Event Control Block (ECB) using the threads services provided by the Distributed Computing Environment (DCE). An ECB can be posted and waited on. An added feature of the ECB implementation presented here is that when the last waiting thread is notified of the post the ECB is automatically reset. A simplification of the ECB, called a "one shot", which eliminates the automatic reset is also disclosed.

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

Event Control Block Wait and Post Semantics for Distributed Computing
Environment / POSIX Threads

      Disclosed is an implementation of the semantics of an Event
Control Block (ECB) using the threads services provided by the
Distributed Computing Environment (DCE).  An ECB can be posted and
waited on.  An added feature of the ECB implementation presented here
is that when the last waiting thread is notified of the post the ECB
is automatically reset.  A simplification of the ECB, called a "one
shot", which eliminates the automatic reset is also disclosed.

      Using the DCE threads package to implement signaling between
DCE threads is not as easy as it first appears.  Timing windows creep
into the usage of DCE threads condition variables.  A simple, easy to
understand, wait and post mechanism is desirable.  The semantics of
an ECB provide this and are easy to understand.

      Using an ECB greatly simplifies the setup and usage of the
thread signaling functions provided by DCE.  A SOMObject veneer
provides an object-oriented building block which can be used in
object-oriented programs.  The use of SOMObjects allows the ECB to be
used from a number of different programming languages.

      Creating an ECB using DCE threads centers around the use of a
DCE condition variable, mutex lock, and an integer flag value.  The
combination of these three things in a C structure along with a set
of C subroutines to operate on the structure provide the semantics of
an ECB.  Specifically, a DCE ECB can be created and destroyed, and
attached to and detached from.  Once created and/or attached to, the
ECB can be be posted or waited on.

      The complexity of managing the inter-play between the condition
variable and the mutex are hidden to the user.  The flag value
eliminates some of the "timing windows" associated with DCE mutexes
and condition variables.

      On creation of the ECB, the C structure is initialized,
including the condition variable and mutex lock.  The flag is set to

0.  A reference count is initialized to 1.  The destroy operation
will fail unless the last referencing thread is making the destroy
call.  The reference count is decremented, however.  This allows all
attached threads to call destroy (as opposed to detach) so that the
last "destroyer" will destroy the C data structure and de-allocate
any allocated storage.  The attach operation increments the reference
count by 1.  The detach operation decrements the reference count by
1.

      The post operation takes an integer value on input.  This value
is stored in the flag in the C structure and can be used for whatever
purpose the exploiter sees fit.  This value will be provided to all
waiting threads.  The condition variable is then signaled via a
broadcast type signal.

      The wait operation contains the bulk of the processing which
implements the logic of the ECB.  Upon entering the wait operation,
if the ECB is "pos...