summaryrefslogtreecommitdiff
path: root/docs/tutorials/017/page01.html
blob: 4288bffc58f4bada13b79cf84feb73d50f0398cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!-- $Id$ -->
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="Author" CONTENT="James CE Johnson">
   <TITLE>ACE Tutorial 017</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F">

<CENTER><B><FONT SIZE=+2>ACE Tutorial 017</FONT></B></CENTER>

<CENTER><B><FONT SIZE=+2>Using the ACE_Barrier synch object</FONT></B></CENTER>

<P>
<HR WIDTH="100%">
The ACE_Barrier implements the barrier synchronization pattern.
<P>
That's nice.  What does it mean?
<P>
What it means is that you can use the ACE_Barrier to cause a set of
threads to all wait at a specific point in your application.  In other
words:  the threads reach a barrier that none can pass until all are
present.
<P>
This would typically be used in scientific applications where a set of
threads are all working in parallel on some great computation but they
have to synch and summarize before continuing to the next stage of calculation.  With
proper use of ACE_Barrier, the threads can easily synch before
continuing.
<P>
In this tutorial I'll create a simple wrapper for the ACE_Barrier.  In
reality, the ACE_Barrier is so easy that a wrapper isn't really
needed.  I created the wrapper anyway though just because I wanted to.
<P>
Kirthika's abstract:
<ul>
The ACE_Barrier class is used for collective thread syncronisation. All
the threads block at the barrier and advance only after everyone is at
the
barrier. A thread blocks by calling the wait() method and stays until
all the other threads invoke wait() one-by-one at the barrier and then
all
move ahead.
Here, an abstract barrier class is created which incorporates the
ACE_Barrier
mechanism and is used in a test case of an ACE_Task with 10 and 5
threads respectively
which illustrate the use of the barrier pattern.
</ul>
<P><HR WIDTH="100%">
<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page02.html">Continue This Tutorial</A>]</CENTER>