summaryrefslogtreecommitdiff
path: root/docs/tutorials/021
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorials/021')
-rw-r--r--docs/tutorials/021/client.cpp10
-rw-r--r--docs/tutorials/021/combine.shar8
-rw-r--r--docs/tutorials/021/mpool.cpp6
-rw-r--r--docs/tutorials/021/mpool.h4
-rw-r--r--docs/tutorials/021/page01.html15
-rw-r--r--docs/tutorials/021/page02.html19
-rw-r--r--docs/tutorials/021/page03.html13
-rw-r--r--docs/tutorials/021/page04.html5
-rw-r--r--docs/tutorials/021/page05.html5
-rw-r--r--docs/tutorials/021/page06.html3
-rw-r--r--docs/tutorials/021/server.cpp18
11 files changed, 56 insertions, 50 deletions
diff --git a/docs/tutorials/021/client.cpp b/docs/tutorials/021/client.cpp
index 9620b24e69d..4ec10f7b4f8 100644
--- a/docs/tutorials/021/client.cpp
+++ b/docs/tutorials/021/client.cpp
@@ -4,7 +4,7 @@
#include "mpool.h"
#if defined(ACE_LACKS_SYSV_SHMEM)
-int
+int
main (int, char *[])
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -47,7 +47,7 @@ main (int, char *[])
*/
char *shm = (char *) region;
- ACE_DEBUG ((LM_INFO,
+ ACE_DEBUG ((LM_INFO,
"Shared memory is at 0x%x\n",
shm));
@@ -81,7 +81,7 @@ main (int, char *[])
/*
Now that we know it is safe to access the data, we'll run
- through and make sure that it contains what we think the server
+ through and make sure that it contains what we think the server
supplied.
*/
for (int i = 0; i < Constants::SHMSZ; i++)
@@ -90,7 +90,7 @@ main (int, char *[])
/*
Look back at the server. After filling the region, it will
attempt to acquire the lock on 'synch'. It will wait there
- until we release() the semaphore. That will allow it to remove
+ until we release() the semaphore. That will allow it to remove
the pool and cleanup. We can simply exit once we perform the
release. (Ok, a free() of the region would probably be polite...)
*/
@@ -98,7 +98,7 @@ main (int, char *[])
ACE_ERROR_RETURN ((LM_ERROR,
"(%P) client synch.release"),
1);
-
+
return 0;
}
diff --git a/docs/tutorials/021/combine.shar b/docs/tutorials/021/combine.shar
index 4249db20bc8..1df4875c662 100644
--- a/docs/tutorials/021/combine.shar
+++ b/docs/tutorials/021/combine.shar
@@ -3,8 +3,8 @@
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
-# Made on 1999-04-03 17:13 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/021'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/021'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -66,7 +66,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh14864; then
+if mkdir _sh05289; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -394,5 +394,5 @@ SHAR_EOF
$echo 'page04.pst:' 'original size' '786,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh14864
+rm -fr _sh05289
exit 0
diff --git a/docs/tutorials/021/mpool.cpp b/docs/tutorials/021/mpool.cpp
index 8b7654cf125..7e55555e5bb 100644
--- a/docs/tutorials/021/mpool.cpp
+++ b/docs/tutorials/021/mpool.cpp
@@ -1,5 +1,5 @@
-// $Id$
+// $Id$
#include "mpool.h"
@@ -50,11 +50,11 @@ Allocator::~Allocator (void)
exception!
The other concern is thread safety. If two threads call here at
about the same time, we may create the pool twice. We can't use a
- Singleton because we want to have multiple Allocator instances. The
+ Singleton because we want to have multiple Allocator instances. The
Singleton techniques can be used though.
*/
-Allocator::pool_t &
+Allocator::pool_t &
Allocator::pool (void)
{
if (pool_ == 0)
diff --git a/docs/tutorials/021/mpool.h b/docs/tutorials/021/mpool.h
index 96a238f2ff4..fbb18e21e57 100644
--- a/docs/tutorials/021/mpool.h
+++ b/docs/tutorials/021/mpool.h
@@ -34,7 +34,7 @@ protected:
// The name we gave to the pool
char *name_;
-
+
pool_t *pool_;
};
@@ -57,7 +57,7 @@ public:
// The name assigned to the memory pool by the server is needed
// by the client. Without it, the pool cannot be found.
- // Likewise, the name the server will bind() to the region of the
+ // Likewise, the name the server will bind() to the region of the
// pool must be available to the client.
static const char *PoolName;
static const char *RegionName;
diff --git a/docs/tutorials/021/page01.html b/docs/tutorials/021/page01.html
index e3f13fee257..c3b3c4eab43 100644
--- a/docs/tutorials/021/page01.html
+++ b/docs/tutorials/021/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -17,18 +18,18 @@
files.
<p>
If we move the level of abstraction up just a bit, the next
- thing we encounter is memory pools. ACE_Malloc&lt;&gt; provides
+ thing we encounter is memory pools. ACE_Malloc&lt;&gt; provides
this to us.
<p>
In this tutorial, we'll use ACE_Malloc&lt;&gt; to create a
- memory pool that is sharable between a client and server. We'll
+ memory pool that is sharable between a client and server. We'll
use a memory mapped file to provide the physical storage but
shared memory works just as well.
<P>
Kirthika's abstract:
<UL>
The ACE_Malloc class is templatised by the type of memory pool
-and the lock for it. The name of the memory pool provided can be used
+and the lock for it. The name of the memory pool provided can be used
in the "bind" call made by the server. This helps the other party
wanting to access it do so by a "find" call. The ACE_Malloc will
allocate
@@ -37,7 +38,7 @@ When the memory chunk is freed by the user, it will be appended to the
free list maintained by the class. Unless a "remove" is done explicitly,
the memory wont be returned to the OS. Various memory pool types can be
used,
- ACE_MMap_Memory_Pool,ACE_Sbrk_Memory_Pool to name a few.
+ ACE_MMap_Memory_Pool,ACE_Sbrk_Memory_Pool to name a few.
For further details: <A HREF="../../ace/Memory_Pool.h">ace/Memory_Pool.h</A>.
<P>
In this tutorial, a ACE_Malloc class with ACE_MMAP_MEMORY_POOL
@@ -46,13 +47,13 @@ the server initially and released after it writes into it so that
the client waiting for it can go ahead and do its job. There is yet
another semaphore used by the server to exit only after the client
has finished its task, which is locked by the client at the start
-and released when its done.
+and released when its done.
<P>
Some more information regarding memory management:
ACE also provides the ACE_Allocator class which uses
-dynamic binding and is flexible, though at a cost of using
+dynamic binding and is flexible, though at a cost of using
virtual pointer tables. Also, there is an ACE_Allocator_Adapter class
-which has an ACE_Allocator interface but ACE_Malloc functionality.
+which has an ACE_Allocator interface but ACE_Malloc functionality.
<P>
Bottomline: Memory can be managed either using the ACE_Allocator
set of classes which uses polymorphism and is thus flexible but not as
diff --git a/docs/tutorials/021/page02.html b/docs/tutorials/021/page02.html
index 2aac4677274..8f48d770840 100644
--- a/docs/tutorials/021/page02.html
+++ b/docs/tutorials/021/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -42,10 +43,10 @@ int
main (int, char *[])
{
<font color=red>/*
- Construction of an Allocator will create the memory pool and
+ Construction of an Allocator will create the memory pool and
provide it with a name. The Constants class is also
declared in mpool.h to keep server and client on the same
- page. The name is used to generate a unique semaphore which
+ page. The name is used to generate a unique semaphore which
prevents simultaneous access to the pools housekeeping
information. (Note that you still have to provide your own
synch mechanisms for the data *you* put in the poo.)
@@ -69,9 +70,9 @@ main (int, char *[])
ACE_DEBUG ((LM_INFO,
"<font color=green>Shared memory is at 0x%x\n</font>",
shm));
-
+
<font color=red>/*
- Something that we can do with a memory pool is map a name to
+ Something that we can do with a memory pool is map a name to
a region provided by malloc. By doing this, we can
communicate that name to the client as a rendezvous
location. Again, a member of Constants is used to keep the
@@ -85,7 +86,7 @@ main (int, char *[])
100);
<font color=red>/*
- One of the best ways to synch between different processes is
+ One of the best ways to synch between different processes is
through the use of semaphores. ACE_SV_Semaphore_Complex
hides the gory details and lets us use them rather easily.
@@ -97,7 +98,7 @@ main (int, char *[])
Both semaphores are created in an initially locked state.
*/</font>
-
+
ACE_SV_Semaphore_Complex mutex;
ACE_ASSERT (mutex.open (<font color=#008888>Constants::SEM_KEY_1</font>,
<font color=#008888>ACE_SV_Semaphore_Complex::ACE_CREATE</font>,
@@ -134,7 +135,7 @@ main (int, char *[])
"<font color=green>(%P) %p</font>",
"<font color=green>server synch.acquire</font>"));
<font color=red>/*
- This will remove all of the memory pool's resources. In the
+ This will remove all of the memory pool's resources. In the
case where a memory mapped file is used, the physical file
will also be removed.
*/</font>
@@ -144,10 +145,10 @@ main (int, char *[])
"<font color=green>server allocator.remove</font>"));
<font color=red>/*
We now have to cleanup the semaphores we created. Use the
- ipcs command to see that they did, indeed, go away after the
+ ipcs command to see that they did, indeed, go away after the
server exits.
*/</font>
-
+
if (mutex.remove () == -1)
ACE_ERROR ((LM_ERROR,
"<font color=green>(%P) %p\n</font>",
diff --git a/docs/tutorials/021/page03.html b/docs/tutorials/021/page03.html
index e2d6e0bf117..510cc08960a 100644
--- a/docs/tutorials/021/page03.html
+++ b/docs/tutorials/021/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -12,7 +13,7 @@
<P>
<HR WIDTH="100%">
- The client side is a little simpler than the server. Mainly
+ The client side is a little simpler than the server. Mainly
because we don't try to delete the pool:
<ul>
<li>Create an Allocator to access the pool
@@ -26,7 +27,7 @@
<font color=blue>#include</font> "<font color=green>mpool.h</font>"
<font color=blue>#if defined</font>(<font color=purple>ACE_LACKS_SYSV_SHMEM</font>)
-int
+int
main (int, char *[])
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -69,7 +70,7 @@ main (int, char *[])
*/</font>
char *shm = (char *) region;
- ACE_DEBUG ((LM_INFO,
+ ACE_DEBUG ((LM_INFO,
"<font color=green>Shared memory is at 0x%x\n</font>",
shm));
@@ -103,7 +104,7 @@ main (int, char *[])
<font color=red>/*
Now that we know it is safe to access the data, we'll run
- through and make sure that it contains what we think the server
+ through and make sure that it contains what we think the server
supplied.
*/</font>
for (int i = 0; i &lt; <font color=#008888>Constants::SHMSZ</font>; i++)
@@ -112,7 +113,7 @@ main (int, char *[])
<font color=red>/*
Look back at the server. After filling the region, it will
attempt to acquire the lock on 'synch'. It will wait there
- until we release() the semaphore. That will allow it to remove
+ until we release() the semaphore. That will allow it to remove
the pool and cleanup. We can simply exit once we perform the
release. (Ok, a free() of the region would probably be polite...)
*/</font>
@@ -120,7 +121,7 @@ main (int, char *[])
ACE_ERROR_RETURN ((LM_ERROR,
"<font color=green>(%P) client synch.release</font>"),
1);
-
+
return 0;
}
diff --git a/docs/tutorials/021/page04.html b/docs/tutorials/021/page04.html
index 00db7ad203e..16140528689 100644
--- a/docs/tutorials/021/page04.html
+++ b/docs/tutorials/021/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -57,7 +58,7 @@ protected:
<font color=red>// The name we gave to the pool</font>
char *name_;
-
+
pool_t *pool_;
};
@@ -94,7 +95,7 @@ public:
template takes two parameters.<sup>*</sup> The first is a
memory pool class to use. ACE has several, I've choosen one
that uses a memory-mapped file. The second parameter is a lock
- class of some sort. This is needed so that the ACE_Malloc<> can
+ class of some sort. This is needed so that the ACE_Malloc<> can
protect its internal data. Note that you still have to
provide your own mutex around the data you put into the
malloc'd area.
diff --git a/docs/tutorials/021/page05.html b/docs/tutorials/021/page05.html
index 4cac1bc9040..dafad1ab0de 100644
--- a/docs/tutorials/021/page05.html
+++ b/docs/tutorials/021/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -67,11 +68,11 @@ const char * <font color=#008888>Constants::RegionName</font> = "<font color=gre
exception!
The other concern is thread safety. If two threads call here at
about the same time, we may create the pool twice. We can't use a
- Singleton because we want to have multiple Allocator instances. The
+ Singleton because we want to have multiple Allocator instances. The
Singleton techniques can be used though.
*/</font>
-<font color=#008888>Allocator::pool_t</font> &
+<font color=#008888>Allocator::pool_t</font> &
<font color=#008888>Allocator::pool</font> (void)
{
if (pool_ == 0)
diff --git a/docs/tutorials/021/page06.html b/docs/tutorials/021/page06.html
index 6b2b67963ef..734dd64e3f7 100644
--- a/docs/tutorials/021/page06.html
+++ b/docs/tutorials/021/page06.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -20,7 +21,7 @@
changing the template parameters. The truly adventurous will
likely find a runtime way of doing this.
<p>
-
+
<ul>
<li><A HREF="Makefile">Makefile</A>
<li><A HREF="server.cpp">server.cpp</A>
diff --git a/docs/tutorials/021/server.cpp b/docs/tutorials/021/server.cpp
index 049e893049d..a89fba799b5 100644
--- a/docs/tutorials/021/server.cpp
+++ b/docs/tutorials/021/server.cpp
@@ -19,10 +19,10 @@ int
main (int, char *[])
{
/*
- Construction of an Allocator will create the memory pool and
+ Construction of an Allocator will create the memory pool and
provide it with a name. The Constants class is also
declared in mpool.h to keep server and client on the same
- page. The name is used to generate a unique semaphore which
+ page. The name is used to generate a unique semaphore which
prevents simultaneous access to the pools housekeeping
information. (Note that you still have to provide your own
synch mechanisms for the data *you* put in the poo.)
@@ -46,9 +46,9 @@ main (int, char *[])
ACE_DEBUG ((LM_INFO,
"Shared memory is at 0x%x\n",
shm));
-
+
/*
- Something that we can do with a memory pool is map a name to
+ Something that we can do with a memory pool is map a name to
a region provided by malloc. By doing this, we can
communicate that name to the client as a rendezvous
location. Again, a member of Constants is used to keep the
@@ -62,7 +62,7 @@ main (int, char *[])
100);
/*
- One of the best ways to synch between different processes is
+ One of the best ways to synch between different processes is
through the use of semaphores. ACE_SV_Semaphore_Complex
hides the gory details and lets us use them rather easily.
@@ -74,7 +74,7 @@ main (int, char *[])
Both semaphores are created in an initially locked state.
*/
-
+
ACE_SV_Semaphore_Complex mutex;
ACE_ASSERT (mutex.open (Constants::SEM_KEY_1,
ACE_SV_Semaphore_Complex::ACE_CREATE,
@@ -111,7 +111,7 @@ main (int, char *[])
"(%P) %p",
"server synch.acquire"));
/*
- This will remove all of the memory pool's resources. In the
+ This will remove all of the memory pool's resources. In the
case where a memory mapped file is used, the physical file
will also be removed.
*/
@@ -121,10 +121,10 @@ main (int, char *[])
"server allocator.remove"));
/*
We now have to cleanup the semaphores we created. Use the
- ipcs command to see that they did, indeed, go away after the
+ ipcs command to see that they did, indeed, go away after the
server exits.
*/
-
+
if (mutex.remove () == -1)
ACE_ERROR ((LM_ERROR,
"(%P) %p\n",