summaryrefslogtreecommitdiff
path: root/doc/HACKING
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-11-12 12:05:05 -0500
committerNick Mathewson <nickm@torproject.org>2019-11-12 12:05:05 -0500
commitd1a1631a05521279041a9ed41383d886e5580250 (patch)
tree18801c8355fd91bc4c4018d113cb30701593636d /doc/HACKING
parent91f377deec9d2d65f8bebe1ac7ea01974b90d376 (diff)
downloadtor-d1a1631a05521279041a9ed41383d886e5580250.tar.gz
tor-d1a1631a05521279041a9ed41383d886e5580250.zip
01f-threads.md becomes threading.dox.
Diffstat (limited to 'doc/HACKING')
-rw-r--r--doc/HACKING/design/01f-threads.md26
1 files changed, 0 insertions, 26 deletions
diff --git a/doc/HACKING/design/01f-threads.md b/doc/HACKING/design/01f-threads.md
deleted file mode 100644
index a0dfa2d40e..0000000000
--- a/doc/HACKING/design/01f-threads.md
+++ /dev/null
@@ -1,26 +0,0 @@
-
-## Threads in Tor ##
-
-Tor is based around a single main thread and one or more worker
-threads. We aim (with middling success) to use worker threads for
-CPU-intensive activities and the main thread for our networking.
-Fortunately (?) we have enough cryptography that moving what we can of the
-cryptographic processes to the workers should achieve good parallelism under most
-loads. Unfortunately, we only have a small fraction of our
-cryptography done in our worker threads right now.
-
-Our threads-and-workers abstraction is defined in workqueue.c, which
-combines a work queue with a thread pool, and integrates the
-signalling with libevent. Tor main instance of a work queue is
-instantiated in cpuworker.c. It will probably need some refactoring
-as more types of work are added.
-
-On a lower level, we provide locks with tor_mutex_t, conditions with
-tor_cond_t, and thread-local storage with tor_threadlocal_t, all of
-which are specified in compat_threads.h and implemented in an OS-
-specific compat_\*threads.h module.
-
-Try to minimize sharing between threads: it is usually best to simply
-make the worker "own" all the data it needs while the work is in
-progress, and to give up ownership when it's complete.
-