/usr/share/doc/ctsim-doc/html/ctsim116.html is in ctsim-doc 5.2.0-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | <HTML>
<head><title>Background Processing</title></head>
<BODY BGCOLOR=#FFFFFF>
<A NAME="backgroundprocessing"></A><CENTER>
<A HREF="ctsim_contents.html">Contents</A> <A HREF="ctsim114.html#algorihms">Up</A> <A HREF="ctsim115.html#phantomprocessing"><<</A> <A HREF="ctsim117.html#topic72">>></A> </CENTER><HR>
<H2>Background Processing</H2>
<B>Key Concepts</B><BR>
<TT>Multithreading</TT><BR>
<TT>Critical sections</TT><BR>
<TT>Message passing</TT><BR>
<TT>Re-entrant code</TT><BR>
<P>
The <TT>CTSim</TT> graphical shell can optionally perform background
processing. <TT>CTSim</TT> uses threads as tools to achieve this
functionality. Using multiple threads, termed
<EM>multithreading</EM>, allows <TT>CTSim</TT> to:<P>
<UL>
<LI> Execute a lengthy calculation in the background while the graphical shell remains
available for use.
<LI> Automatically take advantage of multiple central processing units (CPU's) in a
symmetric multiprocessing (SMP) computer.
</UL>
<P>
When background processing option is turned on or when <TT>CTSim</TT> is
running on a SMP computer, and <TT>CTSim</TT> is directed to perform
reconstruction, rasterization, or projections, <TT>CTSim</TT> will spawn
a <EM>Background Supervisor</EM> thread. This supervisor thread then
creates a <EM>Supervisor Event Handler</EM> (supervisor). The
supervisor communicates with the rest of graphical user interface
of <TT>CTSim</TT> by using message passing to avoid issues with
re-entrant code.<P>
The supervisor registers itself via message passing with the
<EM>Background Manager</EM> which will display the execution
progress in a pop-up window. The supervisor also registers itself
with the document being processed. This is done so that if the
document is closed, the document can send a message to the
supervisor directing the supervisor to cancel the calculation.<P>
After registering with <TT>CTSim</TT> components, the supervisor creates
<EM>Worker Threads</EM>. These worker threads are the processes that
actually perform the calculations. By default, <TT>CTSim</TT> will create
one worker thread for every CPU in the system. As the workers
complete unit blocks, they notify the supervisor. The supervisor
then sends progress messages to background manager which displays
a gauge of the progress.<P>
As the worker threads directly call the supervisor, it is crucial
to lock the class data structures with <EM>Critical Sections</EM>.
Critical sections lock areas of code and prevent more than one
thread to access a section of code at a time. This is used when
maintaining the tables of worker threads in the supervisor.<P>
After the workers have completed their tasks, they notify the
supervisor. When all the workers have finished, the supervisor
kills the worker threads. The supervisor then collates the work
units from the workers and sends a message to <TT>CTSim</TT> to create a
new window to display the finished work.<P>
The supervisor then deregisters itself via messages with the
background manager and the document. The background manager
removes the progress gauge from its display and resizes its
window. Finally, the background supervisor exits and background
supervisor thread terminates.<P>
This functionality has been compartmentalized into inheritable C++
classes <TT>BackgroundSupervisor</TT>,
<TT>BackgroundWorkerThread</TT>, and
<TT>BackgroundProcessingDocument</TT>. These classes serve as base
classes for the reconstruction, rasterization, and projection
multithreading classes.<P>
<A HREF="ctsim117.html#topic72"><B>Advantages</B></A><BR>
<A HREF="ctsim118.html#topic73"><B>Disadvantages</B></A><BR>
</FONT></BODY></HTML>
|