<!-- page01.html,v 1.5 2000/03/19 20:09:32 jcej Exp --> <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>