Next Previous Contents

## 8. Threads

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.

Pioctl calls are handled by routines defined in vproc_pioctl.cc. This file is effectively one large case statement to distinguish among opcodes.

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.

Typically the routines in these files call methods of the FSDB to find the appropiate objects and manipulate their data.

Operations such as resolution and re-integration are handled by special daemon threads.

- vproc -- basic thread type. handles requests in VFS interface (transient)
- type (worker, mariner, callback, resolver, reintegrator, daemons)
- LWP id
- LWP priority
- message ID (sequence number)
- flags (idle, prefetch, etc.)
- name
- function
- vpid (venus thread id)
- uarea -- things the thread needs to carry with it
  - return code
  - user identifiers
  - priority
  - link to volume
  - vfs operation
  - process/group id of calling process
  - counts to guard against infinite retry loops
- data collection

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.

- worker -- generic worker thread, derived from vproc
- opcode,
- message

daemon threads for each subsystem (volume, comm, rvm, etc.)

Next Previous Contents