News
Map
About

 


Threads Overview

What Are Threads?

The term thread is short for thread of execution. It is a way of describing processes running in parallel within the same application.

Threads are a powerful tool, but can also be tricky. They are typically used to split a task into a number of subtasks that can run nearly independently, with a main thread or primary thread of execution waiting on their completion, then acting on the aggregate of their results.

The catch is the word nearly. It is often necessary to share resources (data values, functions, TCP streams, etc.) between different threads. Doing this without one thread interfering with another can be tricky. Semaphores allow threads to synchronize their use of shared resources.

It is also very easy for one process in a threaded application to keep all other processes from executing. This is called hogging the CPU. Threads must yield to allow other processes to run in parallel.

Semaphores and yielding the CPU are the next two topics in the tutorial.

Now let's take a look at the semaphores.



Page 1: Threads Overview
Page 2: Semaphores--Traffic Control for Threads
Page 3: How to Be Thread-Friendly
Page 4: Rules of Thread Safety
Page 5: An Example
Page 6: Frontier's Thread Verbs
Page 7: Thread Utilities
Page 8: Glossary of Terms
Page 9: About the Author


News - Map - About ScriptMeridian

This tutorial was written by Samuel Reynolds in Parker, CO.
Page last revised 1998/11/06; 3:37:03 PM.
Copyright © 1998 ScriptMeridian. All rights reserved
All trademarks are the property of their respective owners.
9:32:15 PM 17 November 1998