Browse Prior Art Database

Portable Co-Operative Multi-Threading Via Modified Procedural Cell

IP.com Disclosure Number: IPCOM000113868D
Original Publication Date: 1994-Oct-01
Included in the Prior Art Database: 2005-Mar-27
Document File: 2 page(s) / 96K

Publishing Venue

IBM

Related People

Renshaw, DS: AUTHOR

Abstract

Modern operating systems such as OS/2* provide a multi-tasking environment which supports both multiple processes within the system and multiple "light-weight" processes (threads) within each process. Each thread within a process has addressability to the same memory as its peer threads within the same process. Each thread is viewed by the operating system as a separately dispatchable and thus separately waitable execution unit. The existence of a threading capability within the operating system allows the application programmer far greater flexibility and leads to simplified applications. Several of the current operating systems e.g.

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

Portable Co-Operative Multi-Threading Via Modified Procedural Cell

      Modern operating systems such as OS/2* provide a multi-tasking
environment which supports both multiple processes within the system
and multiple "light-weight" processes (threads) within each process.
Each thread within a process has addressability to the same memory as
its peer threads within the same process.  Each thread is viewed by
the operating system as a separately dispatchable and thus separately
waitable execution unit.  The existence of a threading capability
within the operating system allows the application programmer far
greater flexibility and leads to simplified applications.  Several of
the current operating systems e.g., AIX* or VM/CMS, provide
multi-tasking but do not provide a threading capability and thus
porting of applications written to exploit threading to these
platforms causes severe problems and often requires major re-writing
or re-design.  This reduces the ability of application developer to
use common code across platforms.  Much of the portability problem
can be removed if a cooperative multi-threading package is added to
the deficient environment.  While this cannot fully replace
pre-emptive multi-tasking of threads by the operating system it can
assist greatly in the porting of the majority of multi-threaded
applications.  Several such co-operative multi-threading mechanisms
have been implemented previously to provide this capability within
products i.e., the CICS task control component.  The major problem is
that they are highly specific to both the particular product and the
operating system and hardware on which they execute.  These packages
are often written in Assembler language and are not readily portable
to other operating system and hardware platforms.

      Nearly all current operating system platforms support at least
one C compiler and attendant runtime library.  In addition each
system defines a calling convention between program procedures in
terms of the hardware platforms assembly language.  By utilizing
these two factors it is possible to create a cooperative
multi-threading package which can be ported to any hardware/operating
system platform with the absolute minimum of system dependant code.
System dependant code will usually be documented in the systems
compiler documentation except a very few lines.  The solution
requires the definition of a control block to represent each
execution thread, a Thread Control Area (TCA), and two simple
procedures to perform a context switch between threads and to
initiate new threads.  The TCA m...