% File:    pthreads.tex
% Author:  Florian Matthes
% Date:    21-FEB-1994 
% Purpose: Paper on Persistent Threads
\documentstyle[12pt,a4,xple_sl,epsf]{article}

% -- Macros:
\newcommand{\figsep}{\noindent\rule{\textwidth}{0.5pt}}
\newcommand{\e}[1]{{\em #1\/}}
\newcommand{\p}[1]{{\sl{}#1}}
\newcommand{\k}[1]{{\bf{}#1}}
\newcommand{\R}{$\Rightarrow$}
\newcommand{\r}{$\rightarrow$}
\newcommand{\comment}[1]{ [[ #1 ]] }

\title{Persistent Threads$^1$}
\author{Florian Matthes \and Joachim~W.~Schmidt}

\date{\small Universit\"at Hamburg\\Vogt-K\"olln Stra{\ss}e 30\\D-22527 Hamburg, Germany\\
      {\small \{matthes,J\_Schmidt\}@dbis1.informatik.uni-hamburg.de}}

\begin{document}
\maketitle

\begin{abstract} \noindent Persistent threads are a database programming 
concept particularly well-suited for applications that manage long-term,
distributed or cooperative activities.  We introduce persistent threads
as a novel form of bindings from data in persistent object stores to
activated code and relate them to existing binding concepts found in
database programming.  We also describe the integration of persistent
threads into a polymorphically-typed database language and its
supporting layered system architecture with particular emphasis on
abstractly-defined thread representations which support thread analysis,
optimization and portability.
\end{abstract}

\noindent\k{Keywords:} Persistence, Thread, Binding, Activity
Management, Database Programming, Higher-Order Languages, Persistent
Object Stores.

\addtocounter{footnote}{1}\footnotetext{This research is supported by
ESPRIT Basic Research, Project FIDE, \#6309.\\
A shorter version of this text appeared in the Proceedings of the
Twentieth Conference on Very Large Databases, 1994, Santiago, Chile.}

%\tableofcontents
%\newpage

%--------------------------------------------------------------------------
\section{Introduction}
\label{Sec:Intro}

A noticeable trend in database research and database system development
is an increased interest in behavioral and procedural aspects of
information systems.  Data models that describe dynamic processes in
addition to static data structures are capable of capturing more of the
application semantics as exemplified by object-oriented models like
Taxis \cite{MyBeWo80}, ADAPLEX \cite{SFL83}, Galileo
\cite{ACO85} or Fibonacci \cite{AGO91}.  Similarly, database systems
that support procedures, methods, rules or triggers in addition to
persistent data values are capable of factoring-out procedural code from
individual application programs into shared databases.  The positive
effects of eliminating integrity checking, database event detection,
exception handling, or user interface management code from application
programs on the overall system consistency and application programmers'
efficiency have been described amply in the literature (see, for example,
\cite{ABW*90,Manifesto90}).  Consequently, one can perceive a shift from
passive data stores to more active persistent object systems.

In this paper we focus on the intricate binding issues on the borderline 
between ``active code'' and ``passive data'' that arise in persistent 
object systems as soon as one gives up the classical separation between 
short-lived transactions expressed in a host language and long-lived data 
stored in a database.  More specifically, we provide a classification 
scheme for bindings from code to persistent data and vice versa and we 
investigate bindings from persistent data and code to threads, which 
exhibit an interesting duality.  On the one hand side threads can be viewed 
as activities that can be created, executed, synchronized, suspended, 
terminated, etc.  Alternatively, they can be viewed as passive data that 
can be stored persistently, annotated with attributes, associated with 
other persistent data structures, moved between nodes in a network, and 
manipulated by computations.

This duality makes persistent threads a key technology for future
persistent object systems and for applications that manage long-term,
distributed or cooperative activities like computer-aided design,
workgroup communication and workflow management.  Unfortunately, this
duality also invalidates many design assumptions on which today's
volatile thread implementations are based.  Therefore, we also discuss
in some detail implementation aspects of persistent thread bindings.

The specific persistent thread model presented here has been developed
within the context of the persistent programming environment
Tycoon\footnote{Tycoon = typed communicating objects in open
environments.} \cite{MaSc93b,Matt93} where it serves as an abstract
model to shield programmers and application-oriented tools from details
of the underlying system implementation (object store, database language
evaluator, scheduler, recovery subsystem) while being sufficiently
low-level to support a variety of (possibly application-defined)
scheduling and activity management strategies.

The paper is organized as follows: In section~\ref{Sec:Bindings} we
introduce a terminology for the description of bindings to data, code
and threads in persistent systems which we use throughout the paper. We
then review briefly the evolution of database languages in terms of
their binding patterns between data, code and threads.  We argue that
the expressiveness and usability of a database system model is related
directly to the orthogonality of its binding patterns. In
section~\ref{Sec:Activity} we propose a next step in the evolution of
database languages by introducing the concept of first-class bindings to
threads.  We argue that an explicit and orthogonal handling of threads
naturally leads to the concept of persistent threads, a systems
abstraction suitable for novel high-level models for long-term activity
management. Finally, in section~\ref{Sec:Semantics} we report on our
implementation of persistent threads in the Tycoon system based on an
abstractly-defined store protocol, code representation and thread
semantics.

\input{sect2}

\input{sect3}

\input{sect4}

\input{sect5}

%\input{sect6}

%--------------------------------------------------------------------------
\section{Concluding remarks}

This paper gives an abstract view of the evolution of database models and 
languages in terms of bindings between code, data and threads.  We argue 
that the next logical step in this evolution is an improved support for 
activity-oriented applications by introducing first-class persistent 
threads.  We also report on our work in formalizing, implementing and using 
persistent threads in the polymorphic Tycoon database programming 
environment. 

Our distinction between nine patterns of bindings in persistent systems
makes it possible to classify database systems based on their support
for persistent data, object, and activity management.  Moreover, our
presentation of the pitfalls encountered in the implementation of C{\r}D
and D{\r}C bindings in existing systems is intended as a hint to
implementors of D{\r}T bindings not to under-estimate the intrinsic
complexity of persistent threads and to realize the relative simplicity
of the proposed Tycoon execution model and its implementation
architecture.

Finally, it should be noted that persistent threads are an expressive
and efficient, but rather low-level concept for the management of
cooperative activities.  Therefore, we are currently investigating
related database synchronization and communication models that have been
proposed in the literature \cite{GMS87,Reut89,BDSSW93} and how such
models can be realized as polymorphic libraries encapsulating Tycoon's
persistent threads.  This approach to a flexible
reconciliation of system and user needs has proved to be highly
successful in modern programming and operating environments which
offer several higher-level models like monitors, ACID transactions,
transactional RPCs and communicating processes on a common, standardized
thread abstraction available on multiple system platforms
\cite{POSIX,DCE93}.

\bibliographystyle{florian}
{\small
\bibliography{../bib/florian-macros,../bib/florian}
}
\end{document}
