Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 211238da6d926d1ca4390483bb29f586 > files > 101

coda-doc-5.2.0-4mdk.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
 <TITLE> Venus Data Structures: Threads </TITLE>
 <LINK HREF="venus-ds-9.html" REL=next>
 <LINK HREF="venus-ds-7.html" REL=previous>
 <LINK HREF="venus-ds.html#toc8" REL=contents>
</HEAD>
<BODY>
<A HREF="venus-ds-9.html">Next</A>
<A HREF="venus-ds-7.html">Previous</A>
<A HREF="venus-ds.html#toc8">Contents</A>
<HR>
<H2><A NAME="s8">8. Threads </A></H2>

<P>
<P>Threads in Venus come in about a dozen of different types.  Basic
threads handlnig vfs requests are object of type vproc; see vproc.h.
These classes export a very important interface encapsulating the type
of messages and operation dispatched to threads during operation.
Among the exported operations are the vfs operations, which are
spelled out in vproc_vfscalls.cc. 
<P>Pioctl calls are handled by routines defined in vproc_pioctl.cc. This
file is effectively one large case statement to distinguish among
opcodes.
<P>vproc_pathname.cc handles the lookup of names in directories and fills
in a vnode as output. It also contains a routine translating fids to
full pathnames.
<P>Typically the routines in these files call methods of the FSDB to find
the appropiate objects and manipulate their data.
<P>Operations such
as resolution and re-integration are handled by special daemon threads.
<P>
<UL>
<LI>vproc -- basic thread type. handles requests in VFS interface       (transient)</LI>
<LI>    type (worker, mariner, callback, resolver, reintegrator, daemons)</LI>
<LI>    LWP id</LI>
<LI>    LWP priority</LI>
<LI>    message ID (sequence number)</LI>
<LI>    flags (idle, prefetch, etc.)</LI>
<LI>    name</LI>
<LI>    function</LI>
<LI>    vpid (venus thread id)</LI>
<LI>    uarea -- things the thread needs to carry with it
<UL>
<LI>    return code</LI>
<LI>    user identifiers</LI>
<LI>    priority</LI>
<LI>    link to volume</LI>
<LI>    vfs operation</LI>
<LI>    process/group id of calling process</LI>
<LI>    counts to guard against infinite retry loops</LI>
</UL>
</LI>
<LI>    data collection</LI>
</UL>
<P>A derived class from the vprocs are the worker threads
(worker.h). These threads handle the messages delivered to Venus.
Their interface is defined in worker.cc which describes the methods
for handling messages.  This file also contains the operations for
mounting /coda.  A message queue is maintained. Messages are
dispatched to a pool of threads.
<P>
<UL>
<LI>worker -- generic worker thread, derived from vproc</LI>
<LI>    opcode, </LI>
<LI>message</LI>
</UL>
<P>daemon threads for each subsystem (volume, comm, rvm, etc.)
<P>
<P>
<HR>
<A HREF="venus-ds-9.html">Next</A>
<A HREF="venus-ds-7.html">Previous</A>
<A HREF="venus-ds.html#toc8">Contents</A>
</BODY>
</HTML>