summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile7
-rw-r--r--ertyo.tex188
2 files changed, 193 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index a2de352..2a42508 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-all: abstractsonly.pdf gradu.pdf
+all: abstractsonly.pdf ertyo.pdf gradu.pdf
GRAPHVIZ_OPTS=\
-Gpenwidth=2 -Npenwidth=2 -Epenwidth=2
@@ -93,5 +93,8 @@ abstractsonly.pdf: abstractsonly.tex abstracts.tex
gradu.pdf: gradu.tex abstracts.tex gradu.bbl gradu.toc gradu.nls ${FIGURES}
pdflatex -interaction nonstopmode $<
+ertyo.pdf: ertyo.tex ertyo.toc
+ pdflatex -interaction nonstopmode $<
+
clean:
- rm -f *.nlo *.nls *.ilg *.nls-stamp *.lof *.lot *.aux *.log *~ abstractsonly.pdf gradu.pdf *.toc *.blg *.bbl *.eps ${FIGURES}
+ rm -f *.nlo *.nls *.ilg *.nls-stamp *.lof *.lot *.aux *.log *~ abstractsonly.pdf gradu.pdf ertyo.pdf *.toc *.blg *.bbl *.eps ${FIGURES}
diff --git a/ertyo.tex b/ertyo.tex
new file mode 100644
index 0000000..35eccda
--- /dev/null
+++ b/ertyo.tex
@@ -0,0 +1,188 @@
+% vim: set nocin noai nosmartindent:
+\documentclass[11pt,a4paper]{article}
+\usepackage{ucs}
+\usepackage[utf8x]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{txfonts}
+\usepackage{url}
+\usepackage[american]{babel}
+\usepackage[pdftex]{color,graphicx}
+\usepackage{scrpage2}
+\usepackage[onehalfspacing]{setspace}
+
+% UTU compliant page layout
+
+\addtolength{\voffset}{-1.8cm}
+\addtolength{\textheight}{2.8cm}
+\addtolength{\footskip}{6mm}
+\addtolength{\hoffset}{-2cm}
+\setlength{\textwidth}{17cm}
+
+\ifoot[]{}
+\cfoot[]{}
+\ofoot[\small\pagemark]{\pagemark}
+\setlength{\headheight}{1.3\baselineskip}
+
+\begin{document}
+
+\begin{titlepage}
+\begingroup
+
+\begin{singlespace}
+
+\begin{center}
+\vspace*{7.3cm}
+\hrule
+\vspace{.7cm}
+\Large \textbf{Master's project}
+\vspace{.7cm}
+\hrule
+\end{center}
+
+\vspace{\stretch{1}}
+\begin{flushright}
+\begin{minipage}{0.45\textwidth}
+\begin{flushright}
+\small
+UNIVERSITY OF TURKU \\
+\mbox{Department of Information Technology} \\
+\mbox{Computer Science} \\
+\today \\
+Olli Salli \\
+\end{flushright}
+\end{minipage}
+\end{flushright}
+\vspace{\stretch{0}}
+
+\end{singlespace}
+
+\endgroup
+\end{titlepage}
+
+% Table of Contents
+
+\selectlanguage{american}
+
+\clearpage
+
+\tableofcontents
+
+% Text chapters
+
+\section{Introduction}
+
+The topic of my Master's thesis\footnote{\url{http://urn.fi/URN:NBN:fi-fe201208246345}} is
+``Building object-oriented software with the D-Bus messaging system''. D-Bus is a message
+passing-oriented inter-process communication (IPC) system. The focus of the thesis is on practical
+requirements on how D-Bus and similar systems can be used in interactive desktop software. Several
+object-oriented design and implementation techniques that help creating software fulfilling these
+requirements are presented and analyzed.
+
+The ideas presented in the thesis are based on my work on the open-source Telepathy communications
+framework\footnote{\url{http://telepathy.freedesktop.org}}. Telepathy consists of independent
+modules such as protocol backends, account storage and logging services, and user interfaces (UIs).
+The modules are connected together at runtime over the D-Bus messaging bus.
+
+Over the year, the various components of Telepathy have been contributed to by dozens of people.
+This report details those of my own personal contributions that are directly connected with the
+thesis.
+
+\section{Early backend and interface design work}
+
+My involvement with Telepathy started in 2006 with implementing the \texttt{te\-le\-pa\-thy-id\-le}
+protocol backend for the Internet Relay Chat (IRC) protocol. At that point, Telepathy was in its
+infancy, with only one other reasonably complete protocol backend in existence, one for the
+Jabber/XMPP protocol. Telepathy was being taken into use in a software update for the Nokia 770
+Internet Tablet device, which had a slow 200 MHz ARM CPU and only 128 megabytes of RAM.
+
+Section 5.5 of the thesis deals with mechanisms that allow querying the state of multiple objects
+with one D-Bus method call. When I started working on \texttt{te\-le\-pa\-thy-id\-le}, these
+mechanisms didn't exist yet in Telepathy. IRC chat rooms can have thousands of members, which used
+to cause several thousand D-Bus method calls to be made to the protocol backend. With the limited
+resources of the Nokia 770, joining an IRC chat room could thus take minutes. In version 0.13 of the
+Telepathy D-Bus interfaces,\footnote{\url{http://telepathy.freedesktop.org/spec-0.13.html}} we
+changed all operations that worked with contacts to process an arbitrary number of contacts with a
+single call. This improved the performance of Telepathy with IRC to a reasonable level.
+
+Initially, \texttt{telepathy-idle} exposed its functionality over D-Bus by implementing low-level
+stub methods. These stubs were generated from low-level D-Bus introspection data corresponding to
+the Telepathy D-Bus interfaces. As detailed in Section 6.1 of the thesis, this format lacks
+sufficient information for meaningful static typing of more complex method arguments. For this
+reason, a lot of hand-written code was required in \texttt{te\-le\-pa\-thy-id\-le} for the purpose
+of encoding and decoding argument values. Because it implemented the same interfaces, similar code
+was also required in the Telepathy XMPP protocol backend. Over time, we refactored these and some
+other common pieces of the implementation to the \texttt{te\-le\-pa\-thy-glib} library, and in
+May 2007 I completed reimplementing the IRC backend using the
+library\footnote{\url{http://lists.freedesktop.org/archives/telepathy/2007-May/000677.html}}.
+
+\section{UI-side work}
+
+After \texttt{telepathy-idle}, I implemented another Telepathy backend for a proprietary protocol
+using the \texttt{te\-le\-pa\-thy-glib} library. At this point, Telepathy was used in a fairly
+complex setting in the Nokia N800 and N810 devices, successors to the original 770. As a part of
+this work, I investigated some issues with the device freezing in certain communication situations.
+This was caused by certain UI-side Telepathy-related components calling D-Bus methods on each
+other using the pseudo-blocking algorithm, forming a \emph{wait-reorder cycle}, as explained in
+Section~3.5.3 of the thesis.
+
+In Summer 2008, I
+started\footnote{\url{http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=190ecb3d7cd80732d1cd8dc484184a8cfe104707}}
+the \texttt{te\-le\-pa\-thy-qt4} project to enable implementing Telepathy UIs using the Qt framework
+more easily. This was motivated by Nokia acquiring Trolltech, the developer of
+Qt,\footnote{\url{http://press.nokia.com/2008/01/28/nokia-to-acquire-trolltech-to-accelerate-software-strategy/}}
+and eventual rebasing of their Linux device portfolio on Qt. The library later became the basis for
+all messaging-related components in the Harmattan release of their Maemo/MeeGo operating system,
+used in the Nokia N9 mobile phone, and a part of its
+SDK.\footnote{\url{http://harmattan-dev.nokia.com/docs/library/html/libtelepathy-qt4-1-doc/main.html}}
+
+\subsection{Code generation}
+
+As the first part of the \texttt{tp-qt4} project, I implemented machinery to generate low-level
+proxy code for accessing Telepathy service objects. This is at the level described by Section~6.2 of
+the thesis.
+
+At that point, the Telepathy D-Bus interfaces were no longer specified using the bare D-Bus
+introspection format, but an extended version. However, due to differences between the GLib and Qt
+type systems, some further modifications were required to generate Qt code.\footnote{
+\url{http://cgit.freedesktop.org/telepathy/telepathy-spec/log/?id=657342595d19196e7dd00595f754f039796f52f8}}
+To facilitate these, and to enable sharing some parts of the machinery between \texttt{tp-qt4} and
+\texttt{tp-glib}, I also partially reimplemented the \texttt{te\-le\-pa\-thy-glib} code generation
+machinery.\footnote{e.g.~\url{http://lists.freedesktop.org/archives/telepathy-commits/2008-May/000827.html}}
+
+Owing to experience from previous projects, from the start, the generated \texttt{tp-qt4} proxies
+have only made it possible to call methods asynchronously. At the lowest level, the calls are
+represented using \texttt{QD\-Bus\-Pen\-ding\-Call\-Wat\-cher} objects from the Qt framework.
+
+\subsection{Higher-level proxies}
+
+Generated proxies follow the structure of the D-Bus API, for which the prime concern is
+flexibility and efficiency. This occasionally makes the APIs less convenient to use. For this
+reason, both \texttt{tp-qt4} and \texttt{tp-glib} wrap the generated proxies with a hand-written
+higher-level API, as described in the introduction to Chapter 6 of the thesis. I implemented the
+\texttt{tp-qt4} high-level proxies together with Andre Magalhaes and Simon McVittie, among others.
+
+Up to 2010, we were busy implementing basic state caching proxies (thesis section~5.2) for all parts
+of the Telepathy API, and following changes to the other parts of the framework. Because the
+primary target platform of \texttt{tp-qt4} was a mobile phone, special attention was paid to
+avoiding redundant battery-eating wakeups. One artifact of this is the conditional activation
+functionality in the state caching mechanism, described in Section~5.3 of the thesis as the
+``Optional Proxy Features'' pattern.
+
+Another notable feature of the proxies in \texttt{tp-qt4} is wrapping some D-Bus operations inside
+higher level ``job objects''. These are described as the ``Pending Operation Objects'' and
+``Composite Pending Operation'' patterns in Section~5.1 of the thesis. One example is the
+facility for fetching contact information from a protocol backend, using the D-Bus level
+mechanisms described in Section~5.5 of the thesis. The efficiency orientation of these mechanisms
+make them very inconvenient to use directly. For this reason, they are wrapped as pending operations
+in the \texttt{Con\-tact\-Ma\-na\-ger} part of the \texttt{tp-qt4} API, which I implemented in early
+2009.\footnote{\url{http://cgit.freedesktop.org/telepathy/telepathy-qt/log/?id=d86579e34367641c4b2ca23096791950bf9fa72c}}
+
+% 5.4 factories
+% - lots of features, prepare separately, blah blah, hard
+% https://bugs.freedesktop.org/show_bug.cgi?id=29451 (general "it's hard")
+% https://bugs.freedesktop.org/show_bug.cgi?id=29606 (acc/conn fact.)
+
+% 5.5 multiplexed state sync
+% - early 2009: implemented tp-qt4 Contact, ContactManager with Conn.I.Contacts D-Bus API
+
+\end{document}