Browse Prior Art Database

Process Thread Control Procedure

IP.com Disclosure Number: IPCOM000114873D
Original Publication Date: 1995-Feb-01
Included in the Prior Art Database: 2005-Mar-30
Document File: 2 page(s) / 76K

Publishing Venue

IBM

Related People

Jensen, B: AUTHOR [+4]

Abstract

Disclosed is a process by which a section of code within a program can be assured of execution when a thread termination is required. This process is known as the Process Thread Control Procedure (PTCP).

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

Process Thread Control Procedure

      Disclosed is a process by which a section of code within a
program can be assured of execution when a thread termination is
required.  This process is known as the Process Thread Control
Procedure (PTCP).

      Currently, the DosKillThread command can be used to terminate a
thread of a process but there is no way to guarantee that a critical
code segment within the module on that thread will execute to
completion before the thread is terminated.  The DosKillProcess
provides this facility but if only a thread of a process requires
termination, the DosKillProcess often is not an acceptable
alternative.  To solve this problem, PTCP was invented.

      PTCP is a function that performs a controlled thread
termination through two Application Program Interfaces (API) and a
command.  The first API, OS_EnterMustComplete, is used by the
programmer to indicate that a block of code has been entered and must
be executed.  The second API, OS_ExitMustComplete, is used by the
programmer to indicate that a block of code that must complete
execution has been exited.  The command to terminate a thread,
OS_KillThread, causes the thread to terminate if the thread is not
processing code within a code block that must complete execution.

      PTCP performs a controlled thread termination process by
utilizing a table which identifies threads which have entered code
segments that must continue execution.  When a module calls the
OS_EnterMustComplete API, PTCP attempts to open a shared memory
segment named "/EPW/MUSTCOMPLETE/ID".  If not found, it is created
and opened.  PTCP then issues the DosGetPid command to get the
current process ID and thread ID of the caller.  This information is
used to build an entry in the shared memory segment.  The format of
this entry follows:

      In the entry, Process ID and Thread ID uniquely identify the
module that entered a code segment that must be co...