summaryrefslogtreecommitdiff
path: root/docs/tutorials/018/page02.html
blob: 691e8613e5f75e07e7a7ca06f6ec377d165c4b76 (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
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="Author" CONTENT="James CE Johnson">
   <TITLE>ACE Tutorial 018</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F">

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

<CENTER><B><FONT SIZE=+2>The FIFO Nature of ACE_Token</FONT></B></CENTER>

<P>
<HR WIDTH="100%">
Our main() just keeps getting simpler!  I guess that's a good thing.
<P>
What we've done is create two Task-derived objects that test different
locking mechanisms.  The Token object uses ACE_Token and the Mutex
object uses ACE_Mutex.  When you execute the application you should
see quite a difference in thread utilization.  At the end of the
tutorial I've included a link to the output of a typical run of the
application.
<HR>
<PRE>

<font color=red>// $Id$</font>

<font color=red>// Get our two Test derivatives...</font>
<font color=blue>#include</font> "<font color=green>Token_i.h</font>"
<font color=blue>#include</font> "<font color=green>Mutex_i.h</font>"

int main(int,char**)
{
        <font color=red>// See what an ACE_Token does for us.</font>
    Token token;
    token.run();

        <font color=red>// And now and ACE_Mutex.</font>
    Mutex mutex;
    mutex.run();
    
    return(0);
}
</PRE>
<P><HR WIDTH="100%">
<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page03.html">Continue This Tutorial</A>]</CENTER>