Multi-Threading for Experts: Inside a Parallel Application
Semaphore C++ Example Code Multithreading Synchronization HT Technology: The problem of efficient synchronization is among the most difficult tasks of parallel programming. This paper addresses the key challenges of parallel program synchronization. Read it here.

by Sergey N. Zheltov, project manager, and Stanislav V. Bratanov, software engineer, Microprocessor Research, Intel Labs. Intel Corp.

Anyone designing multithreaded applications will agree: the problem of efficient synchronization is among the most difficult tasks of parallel programming. Modern operating systems provide a multitude of synchronization objects, which determine a variety of synchronization methods and schemes.

This article addresses some of the issues of parallel program synchronization and tries to clarify at least a few of them.

Below, several synchronization schemes are discussed; synchronization object behavior is described; internal system implementation of user-visible synchronization objects or functions is also explained where applicable. Hidden timings and latencies are provided; execution thread layout is shown over time, and non-obvious thread time shifts are pointed out.

Readers will also find code examples illustrating important points of the synchronization problem.

All discussions of synchronization objects and algorithms appearing in this article pertain to Microsoft Windows* implementations of such objects and algorithms.

Definitions

Several abbreviations are used throughout the article to denote the following terms:

IPI stands for Inter-Processor Interrupt, an interruption signal sent by one processor to another.

APC, Asynchronous Procedure Call, which is a Microsoft Windows notification scheme enabling the execution of a specified procedure within the context of a specified thread.

Internal Implementation
This article addresses wake-up and signaling schemes which are used to directly control the execution of threads. Schemes of mutual exclusion, which are mostly employed to synchronize resource usage (granting access to a resource to only one thread), are beyond the scope of the article.

Also, in this article we assume that all necessary resources have been already divided between threads; the task is to wake up the thread and load each of them with an appropriate amount of work.

As various mutual exclusion constructions are not within the scope of this article, only two sorts of synchronization objects typically used for signaling are considered: events and semaphores.

Read the rest of this tutorial: click download, below.

© 2005 Intel Corp.


Subscribers who liked this article also read:

If you're interested in this topic, these articles may be helpful:

Parallel computing for imaging applications
from Intel Corp. Desktop developers, it's time to thread your apps....
Detecting Hyper-Threading Technology and dual cores
by Jeff Andrews. Intel Corp. Intel has always continued to improve ...
Getting ready for hyper-threading technology, part I: changing the mindset
by Andrew Binstock, principal analyst, Pacific Data Works LLC. Intel C...
Multi-Core: Intel's new processor architecture explained
by Andrew Binstock, principal analyst, Pacific Data Works LLC. L...
Platform 2015 Software: Enabling Innovation in Parallelism
Without a doubt, computing has made great strides in recent years. But...

Related Jobs:

Technical Project Lead/Application Architect #1278 - MA - Bedford - Progress Software Corporation
Technical Project Lead/Application Architect Location Bedford, MA ...
Software Engineer - NJ - Jersey City - SunGard
Reference No.: n/a Opening Date: May 23, 2006 Job Title: SOFTWARE ...
Senior Software Engineer – Site Framework #8022CE788006BF4E - CA - Oakland - Ask Jeeves,Inc.
Title Senior Software Engineer – Site Framework City Oakland State...
Security Architect #396 - NY - Syracuse - Excellus Blue Cross Blue Shield
Job Title: Security Architect Location: Syracuse-Warren Street ...
MS Operations Manager Analyst #MHMOM - MO - St. Louis - UPP Business Systems
MS Operations Manager Analyst to perform architectural, operational, ...
Systems Engineer #14346 - CT - Middletown - Aetna Inc.
Job Detail Job Title: Systems Engineer Job Group: Informatio...
GSM/Dual Mode System Architect #784 - CA - Milpitas - PalmOne, Inc.
GSM/Dual Mode System Architect Job code: 784 Job Category: Engineeri...
C++/Linux Developer - NY - Manhattan - Athena Archiver
Athena Archiver is a software development company that focuses on exce...
Oracle Apps DBA #12428 - OH - Evendale - Radiant Systems, Inc
Oracle Apps DBA with over 3 years experience in 11i Oracle Apps. Wo...
System Architect #S05-0121 - NY - Syracuse - Excellus Blue Cross Blue Shield
Title: System Architect Department: Security Services Operating Te...