Browse Prior Art Database

Method to Invoke Function Calls with Time-Out Option

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

Publishing Venue

IBM

Related People

Hahn, TJ: AUTHOR

Abstract

Disclosed is a method for using the threads services provided by the Distributed Computing Environment (DCE) to invoke a function with a time-out for processing specified. The method returns a status indicating whether or not the time out was reached before the call completed.

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

Method to Invoke Function Calls with Time-Out Option

      Disclosed is a method for using the threads services provided
by the Distributed Computing Environment (DCE) to invoke a function
with a time-out for processing specified.  The method returns a
status indicating whether or not the time out was reached before the
call completed.

      The solution to this problem centers around the use of a DCE
condition variable, mutex lock, and an additional thread.  The
combination of these three things, hidden within a single C
subroutine, provides a solution to this problem.  This solution is
implemented within  the process space of the program invoking the
service.

A subroutine called "timedCall()"  is the interface to this utility:
  typedef enum {
    TIMEDCALL_COMPLETED=0,
    TIMEDCALL_TIMEOUT
  } timedCallRetCode;
  timedCallRetCode timedCall( int timeToWait,
                           void *(*operationFunction)(void *),
                           void *operationParmList,
                           void (*cleanUpFunction)(void *),
                           void *cleanUpParmList);

      On entry to the function, a DCE mutex lock and condition
variable are initialized.  The mutex is then locked and a new thread
is created, with the function to be invoked along with the passed in
parameter list passed into the thread start routine.  The started
routine first locks the mutex initialized in the original thread.  If
the cleanUpFunction is non-NULL, a thread cleanup handler is setup
using pthread_cleanup_push().  The started thread then invokes the
function passed in on input to the timedCall() routine, supplying
the parameter list to the function that was passed in on input to the
time...