summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjcej <jcej@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-09-22 03:14:02 +0000
committerjcej <jcej@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-09-22 03:14:02 +0000
commit251cb77e8da6e2c956a6fe929e3e6a0b0c3397fa (patch)
tree4b2fe438c5cd19dad7e9527174220e7fcc9daa4b
parent1273cca419871e8c04554dbf4b538f69453b3955 (diff)
downloadATCD-251cb77e8da6e2c956a6fe929e3e6a0b0c3397fa.tar.gz
*** empty log message ***
-rw-r--r--ChangeLog-99b8
-rw-r--r--docs/tutorials/001/combine.shar8
-rw-r--r--docs/tutorials/001/logger.h4
-rw-r--r--docs/tutorials/001/page01.html1
-rw-r--r--docs/tutorials/001/page02.html9
-rw-r--r--docs/tutorials/001/page03.html1
-rw-r--r--docs/tutorials/001/page04.html5
-rw-r--r--docs/tutorials/001/page05.html1
-rw-r--r--docs/tutorials/001/server.cpp4
-rw-r--r--docs/tutorials/002/combine.shar8
-rw-r--r--docs/tutorials/002/handler.h2
-rw-r--r--docs/tutorials/002/page01.html1
-rw-r--r--docs/tutorials/002/page02.html9
-rw-r--r--docs/tutorials/002/page03.html3
-rw-r--r--docs/tutorials/002/page04.html1
-rw-r--r--docs/tutorials/002/server.cpp2
-rw-r--r--docs/tutorials/003/client.cpp4
-rw-r--r--docs/tutorials/003/combine.shar16
-rw-r--r--docs/tutorials/003/page01.html5
-rw-r--r--docs/tutorials/004/client.cpp14
-rw-r--r--docs/tutorials/004/combine.shar8
-rw-r--r--docs/tutorials/004/page01.html21
-rw-r--r--docs/tutorials/005/client_handler.cpp10
-rw-r--r--docs/tutorials/005/client_handler.h2
-rw-r--r--docs/tutorials/005/combine.shar8
-rw-r--r--docs/tutorials/005/page01.html1
-rw-r--r--docs/tutorials/005/page02.html7
-rw-r--r--docs/tutorials/005/page03.html1
-rw-r--r--docs/tutorials/005/page04.html3
-rw-r--r--docs/tutorials/005/page05.html11
-rw-r--r--docs/tutorials/005/page06.html9
-rw-r--r--docs/tutorials/005/page07.html1
-rw-r--r--docs/tutorials/005/page08.html1
-rw-r--r--docs/tutorials/005/server.cpp4
-rw-r--r--docs/tutorials/006/client_acceptor.h4
-rw-r--r--docs/tutorials/006/client_handler.cpp18
-rw-r--r--docs/tutorials/006/combine.shar42
-rw-r--r--docs/tutorials/006/page01.html7
-rw-r--r--docs/tutorials/006/page02.html5
-rw-r--r--docs/tutorials/006/page03.html5
-rw-r--r--docs/tutorials/006/page04.html1
-rw-r--r--docs/tutorials/006/page05.html35
-rw-r--r--docs/tutorials/006/page06.html1
-rw-r--r--docs/tutorials/006/server.cpp4
-rw-r--r--docs/tutorials/007/client_acceptor.cpp4
-rw-r--r--docs/tutorials/007/client_acceptor.h8
-rw-r--r--docs/tutorials/007/client_handler.cpp24
-rw-r--r--docs/tutorials/007/client_handler.h8
-rw-r--r--docs/tutorials/007/combine.shar32
-rw-r--r--docs/tutorials/007/page01.html7
-rw-r--r--docs/tutorials/007/page02.html7
-rw-r--r--docs/tutorials/007/page03.html9
-rw-r--r--docs/tutorials/007/page04.html5
-rw-r--r--docs/tutorials/007/page05.html9
-rw-r--r--docs/tutorials/007/page06.html25
-rw-r--r--docs/tutorials/007/page07.html3
-rw-r--r--docs/tutorials/007/page08.html21
-rw-r--r--docs/tutorials/007/page09.html3
-rw-r--r--docs/tutorials/007/server.cpp6
-rw-r--r--docs/tutorials/007/thread_pool.cpp14
-rw-r--r--docs/tutorials/007/thread_pool.h2
-rw-r--r--docs/tutorials/008/broadcast_client.cpp4
-rw-r--r--docs/tutorials/008/combine.shar8
-rw-r--r--docs/tutorials/008/directed_client.cpp6
-rw-r--r--docs/tutorials/008/page01.html3
-rw-r--r--docs/tutorials/008/page02.html3
-rw-r--r--docs/tutorials/008/page03.html7
-rw-r--r--docs/tutorials/008/page04.html5
-rw-r--r--docs/tutorials/008/page05.html1
-rw-r--r--docs/tutorials/008/server.cpp2
-rw-r--r--docs/tutorials/009/broadcast_client.cpp2
-rw-r--r--docs/tutorials/009/combine.shar16
-rw-r--r--docs/tutorials/009/directed_client.cpp2
-rw-r--r--docs/tutorials/009/page01.html3
-rw-r--r--docs/tutorials/009/page02.html3
-rw-r--r--docs/tutorials/009/page03.html3
-rw-r--r--docs/tutorials/009/page04.html3
-rw-r--r--docs/tutorials/009/page05.html1
-rw-r--r--docs/tutorials/009/server.cpp2
-rw-r--r--docs/tutorials/010/combine.shar23
-rw-r--r--docs/tutorials/010/message_queue.cpp10
-rw-r--r--docs/tutorials/010/page01.html9
-rw-r--r--docs/tutorials/010/page02.html11
-rw-r--r--docs/tutorials/010/page03.html3
-rw-r--r--docs/tutorials/010/page04.html1
-rw-r--r--docs/tutorials/010/page05.html16
-rw-r--r--docs/tutorials/010/page06.html1
-rw-r--r--docs/tutorials/010/page07.html1
-rw-r--r--docs/tutorials/010/task.cpp8
-rw-r--r--docs/tutorials/011/combine.shar21
-rw-r--r--docs/tutorials/011/message_queue.cpp4
-rw-r--r--docs/tutorials/011/page01.html1
-rw-r--r--docs/tutorials/011/page02.html5
-rw-r--r--docs/tutorials/011/page03.html16
-rw-r--r--docs/tutorials/011/page04.html1
-rw-r--r--docs/tutorials/011/page05.html1
-rw-r--r--docs/tutorials/011/page06.html1
-rw-r--r--docs/tutorials/011/task.cpp10
-rw-r--r--docs/tutorials/011/task.h2
-rw-r--r--docs/tutorials/012/combine.shar8
-rw-r--r--docs/tutorials/012/message_queue.cpp4
-rw-r--r--docs/tutorials/012/page01.html7
-rw-r--r--docs/tutorials/012/page02.html7
-rw-r--r--docs/tutorials/012/page03.html7
-rw-r--r--docs/tutorials/012/page04.html5
-rw-r--r--docs/tutorials/012/page05.html19
-rw-r--r--docs/tutorials/012/page06.html1
-rw-r--r--docs/tutorials/012/task.cpp10
-rw-r--r--docs/tutorials/012/task.h2
-rw-r--r--docs/tutorials/013/block.cpp10
-rw-r--r--docs/tutorials/013/block.h2
-rw-r--r--docs/tutorials/013/combine.shar16
-rw-r--r--docs/tutorials/013/message_queue.cpp4
-rw-r--r--docs/tutorials/013/page01.html9
-rw-r--r--docs/tutorials/013/page02.html3
-rw-r--r--docs/tutorials/013/page03.html5
-rw-r--r--docs/tutorials/013/page04.html5
-rw-r--r--docs/tutorials/013/page05.html11
-rw-r--r--docs/tutorials/013/page06.html27
-rw-r--r--docs/tutorials/013/page07.html41
-rw-r--r--docs/tutorials/013/page08.html5
-rw-r--r--docs/tutorials/013/task.cpp30
-rw-r--r--docs/tutorials/013/task.h2
-rw-r--r--docs/tutorials/013/work.cpp22
-rw-r--r--docs/tutorials/014/EndTask.h6
-rw-r--r--docs/tutorials/014/Task.cpp32
-rw-r--r--docs/tutorials/014/page03.html32
-rw-r--r--docs/tutorials/014/page04.html6
-rw-r--r--docs/tutorials/014/page05.html8
-rw-r--r--docs/tutorials/014/page06.html28
-rw-r--r--docs/tutorials/014/stream.cpp8
-rw-r--r--docs/tutorials/015/Compressor.cpp10
-rw-r--r--docs/tutorials/015/Crypt.cpp4
-rw-r--r--docs/tutorials/015/Handler.cpp14
-rw-r--r--docs/tutorials/015/Protocol_Stream.cpp20
-rw-r--r--docs/tutorials/015/Protocol_Task.cpp10
-rw-r--r--docs/tutorials/015/Protocol_Task.h2
-rw-r--r--docs/tutorials/015/Recv.cpp4
-rw-r--r--docs/tutorials/015/Server_i.cpp4
-rw-r--r--docs/tutorials/015/Xmit.cpp6
-rw-r--r--docs/tutorials/015/client.cpp14
-rw-r--r--docs/tutorials/015/combine.shar8
-rw-r--r--docs/tutorials/015/page01.html7
-rw-r--r--docs/tutorials/015/page02.html11
-rw-r--r--docs/tutorials/015/page03.html1
-rw-r--r--docs/tutorials/015/page04.html1
-rw-r--r--docs/tutorials/015/page05.html5
-rw-r--r--docs/tutorials/015/page06.html7
-rw-r--r--docs/tutorials/015/page07.html3
-rw-r--r--docs/tutorials/015/page08.html3
-rw-r--r--docs/tutorials/015/page09.html17
-rw-r--r--docs/tutorials/015/page10.html5
-rw-r--r--docs/tutorials/015/page11.html21
-rw-r--r--docs/tutorials/015/page12.html1
-rw-r--r--docs/tutorials/015/page13.html13
-rw-r--r--docs/tutorials/015/page14.html3
-rw-r--r--docs/tutorials/015/page15.html9
-rw-r--r--docs/tutorials/015/page16.html3
-rw-r--r--docs/tutorials/015/page17.html5
-rw-r--r--docs/tutorials/015/page18.html1
-rw-r--r--docs/tutorials/015/page19.html5
-rw-r--r--docs/tutorials/015/page20.html3
-rw-r--r--docs/tutorials/015/page21.html5
-rw-r--r--docs/tutorials/015/page22.html9
-rw-r--r--docs/tutorials/015/server.cpp2
-rw-r--r--docs/tutorials/016/Condition_i.cpp8
-rw-r--r--docs/tutorials/016/Condition_i.h4
-rw-r--r--docs/tutorials/016/combine.shar8
-rw-r--r--docs/tutorials/016/condition.cpp33
-rw-r--r--docs/tutorials/016/page01.html25
-rw-r--r--docs/tutorials/016/page02.html11
-rw-r--r--docs/tutorials/016/page03.html11
-rw-r--r--docs/tutorials/016/page04.html30
-rw-r--r--docs/tutorials/016/page05.html1
-rw-r--r--docs/tutorials/017/Barrier_i.cpp4
-rw-r--r--docs/tutorials/017/Barrier_i.h4
-rw-r--r--docs/tutorials/017/barrier.cpp22
-rw-r--r--docs/tutorials/017/barrier2.cpp14
-rw-r--r--docs/tutorials/017/combine.shar32
-rw-r--r--docs/tutorials/017/page01.html9
-rw-r--r--docs/tutorials/017/page02.html13
-rw-r--r--docs/tutorials/017/page03.html9
-rw-r--r--docs/tutorials/017/page04.html11
-rw-r--r--docs/tutorials/017/page05.html3
-rw-r--r--docs/tutorials/017/page06.html7
-rw-r--r--docs/tutorials/018/Test_T.cpp14
-rw-r--r--docs/tutorials/018/Test_T.h10
-rw-r--r--docs/tutorials/018/combine.shar8
-rw-r--r--docs/tutorials/018/page01.html35
-rw-r--r--docs/tutorials/018/page02.html16
-rw-r--r--docs/tutorials/018/page03.html17
-rw-r--r--docs/tutorials/018/page04.html17
-rw-r--r--docs/tutorials/018/page05.html3
-rw-r--r--docs/tutorials/018/page06.html9
-rw-r--r--docs/tutorials/018/page07.html5
-rw-r--r--docs/tutorials/018/token.cpp2
-rw-r--r--docs/tutorials/019/client.cpp10
-rw-r--r--docs/tutorials/019/client2.cpp10
-rw-r--r--docs/tutorials/019/combine.shar16
-rw-r--r--docs/tutorials/019/page01.html9
-rw-r--r--docs/tutorials/019/page02.html19
-rw-r--r--docs/tutorials/019/page03.html15
-rw-r--r--docs/tutorials/019/page04.html25
-rw-r--r--docs/tutorials/019/page05.html3
-rw-r--r--docs/tutorials/019/page06.html1
-rw-r--r--docs/tutorials/019/server.cpp16
-rw-r--r--docs/tutorials/019/server2.cpp10
-rw-r--r--docs/tutorials/019/shmem.h2
-rw-r--r--docs/tutorials/020/client.cpp4
-rw-r--r--docs/tutorials/020/client2.cpp4
-rw-r--r--docs/tutorials/020/combine.shar16
-rw-r--r--docs/tutorials/020/mmap.h4
-rw-r--r--docs/tutorials/020/page01.html5
-rw-r--r--docs/tutorials/020/page02.html7
-rw-r--r--docs/tutorials/020/page03.html5
-rw-r--r--docs/tutorials/020/page04.html11
-rw-r--r--docs/tutorials/020/page05.html5
-rw-r--r--docs/tutorials/020/page06.html1
-rw-r--r--docs/tutorials/020/server.cpp4
-rw-r--r--docs/tutorials/020/server2.cpp4
-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
-rw-r--r--docs/tutorials/Makefile2
232 files changed, 1117 insertions, 931 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b
index 390f53fd124..4a2474808bd 100644
--- a/ChangeLog-99b
+++ b/ChangeLog-99b
@@ -1,3 +1,11 @@
+1999-09-21 James CE Johnson <jcej@chiroptera.tragus.org>
+
+ * docs/tutorials/Makefile
+ * docs/tutorials/???/*
+ Added a number of notes about proper usage of THR_NEW_LWP and
+ THR_DETACHED. Rebuilt all of the .html and .shar files. Probably
+ touched too many along the way but better safe than sorry.
+
Tue Sep 21 21:56:10 1999 David L. Levine <levine@cs.wustl.edu>
* docs/ACE-subsets.html: replaced absolute link to
diff --git a/docs/tutorials/001/combine.shar b/docs/tutorials/001/combine.shar
index 8dcf0ab3f72..242bfc7582f 100644
--- a/docs/tutorials/001/combine.shar
+++ b/docs/tutorials/001/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-01-17 14:14 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/001'.
+# Made on 1999-09-21 22:48 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/001'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -67,7 +67,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh00080; then
+if mkdir _sh04675; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -570,5 +570,5 @@ SHAR_EOF
$echo 'page04.pst:' 'original size' '279,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh00080
+rm -fr _sh04675
exit 0
diff --git a/docs/tutorials/001/logger.h b/docs/tutorials/001/logger.h
index 69d19505d60..e292250e17a 100644
--- a/docs/tutorials/001/logger.h
+++ b/docs/tutorials/001/logger.h
@@ -44,7 +44,7 @@ public:
if (reactor->register_handler (this,
ACE_Event_Handler::READ_MASK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_ERROR_RETURN ((LM_ERROR,
"(%P|%t) can't register with reactor\n"),
-1);
return 0;
@@ -89,7 +89,7 @@ protected:
virtual int handle_input (ACE_HANDLE)
{
/*
- Create and initialize a small receive buffer. The extra byte is
+ Create and initialize a small receive buffer. The extra byte is
there to allow us to have a null-terminated string when it's over.
*/
char buf[BUFSIZ + 1];
diff --git a/docs/tutorials/001/page01.html b/docs/tutorials/001/page01.html
index 3155a0b9c18..103193ef12e 100644
--- a/docs/tutorials/001/page01.html
+++ b/docs/tutorials/001/page01.html
@@ -1,4 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<!-- $Id$ -->
<HTML>
<HEAD>
<TITLE>ACE Tutorial 001</TITLE>
diff --git a/docs/tutorials/001/page02.html b/docs/tutorials/001/page02.html
index 560f092dd21..cc502bfc859 100644
--- a/docs/tutorials/001/page02.html
+++ b/docs/tutorials/001/page02.html
@@ -1,4 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<!-- $Id$ -->
<HTML>
<HEAD>
<TITLE>ACE Tutorial 001</TITLE>
@@ -48,8 +49,8 @@ client requests in its handle_input() method. It is also registered
with the Reactor with the ACE_Event_Handler::READ_MASK.
<P>
The Event_Handlers can be unregistered from the Reactor using
-handle_close() methods
-or explicitly calling the remove_handler() methods.
+handle_close() methods
+or explicitly calling the remove_handler() methods.
<P>
This server application builds and executes succesfully waiting for
client requests to arrive.
@@ -92,7 +93,7 @@ ACE_Reactor *g_reactor;
we're satisfied with simply hard-coding a random but known value. */</font>
static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
-int
+int
main (int, char *[])
{
<font color=red>/* Create a Reactor instance. Again, a global pointer isn't exactly
@@ -125,7 +126,7 @@ main (int, char *[])
connections via the 'addr' object. We're also telling it that we
want it to be registered with our 'g_reactor' instance. */</font>
if (peer_acceptor->open (addr, g_reactor) == -1 )
- ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_ERROR_RETURN ((LM_ERROR,
"<font color=green>Opening Acceptor\n</font>"),
-1);
diff --git a/docs/tutorials/001/page03.html b/docs/tutorials/001/page03.html
index 00a8d4c7646..73a2a9776f1 100644
--- a/docs/tutorials/001/page03.html
+++ b/docs/tutorials/001/page03.html
@@ -1,4 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<!-- $Id$ -->
<HTML>
<HEAD>
<TITLE>ACE Tutorial 001</TITLE>
diff --git a/docs/tutorials/001/page04.html b/docs/tutorials/001/page04.html
index 58bc6d5848e..0f8d7557c39 100644
--- a/docs/tutorials/001/page04.html
+++ b/docs/tutorials/001/page04.html
@@ -1,4 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<!-- $Id$ -->
<HTML>
<HEAD>
<TITLE>ACE Tutorial 001</TITLE>
@@ -65,7 +66,7 @@ public:
if (reactor->register_handler (this,
<font color=#008888>ACE_Event_Handler::READ_MASK</font>) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_ERROR_RETURN ((LM_ERROR,
"<font color=green>(%P|%t) can't register with reactor\n</font>"),
-1);
return 0;
@@ -110,7 +111,7 @@ protected:
virtual int handle_input (ACE_HANDLE)
{
<font color=red>/*
- Create and initialize a small receive buffer. The extra byte is
+ Create and initialize a small receive buffer. The extra byte is
there to allow us to have a null-terminated string when it's over.
*/</font>
char buf[BUFSIZ + 1];
diff --git a/docs/tutorials/001/page05.html b/docs/tutorials/001/page05.html
index 8725e1f410f..f53302a2c4a 100644
--- a/docs/tutorials/001/page05.html
+++ b/docs/tutorials/001/page05.html
@@ -1,4 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<!-- $Id$ -->
<HTML>
<HEAD>
<TITLE>ACE Tutorial 001</TITLE>
diff --git a/docs/tutorials/001/server.cpp b/docs/tutorials/001/server.cpp
index f7deb7a9075..e5922a56422 100644
--- a/docs/tutorials/001/server.cpp
+++ b/docs/tutorials/001/server.cpp
@@ -22,7 +22,7 @@ ACE_Reactor *g_reactor;
we're satisfied with simply hard-coding a random but known value. */
static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
-int
+int
main (int, char *[])
{
/* Create a Reactor instance. Again, a global pointer isn't exactly
@@ -55,7 +55,7 @@ main (int, char *[])
connections via the 'addr' object. We're also telling it that we
want it to be registered with our 'g_reactor' instance. */
if (peer_acceptor->open (addr, g_reactor) == -1 )
- ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_ERROR_RETURN ((LM_ERROR,
"Opening Acceptor\n"),
-1);
diff --git a/docs/tutorials/002/combine.shar b/docs/tutorials/002/combine.shar
index 498d2be4a46..e3f35577e91 100644
--- a/docs/tutorials/002/combine.shar
+++ b/docs/tutorials/002/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-01-17 14:20 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/002'.
+# Made on 1999-09-21 22:48 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/002'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -63,7 +63,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh00205; then
+if mkdir _sh04705; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -324,5 +324,5 @@ SHAR_EOF
$echo 'page04.pre:' 'original size' '448,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh00205
+rm -fr _sh04705
exit 0
diff --git a/docs/tutorials/002/handler.h b/docs/tutorials/002/handler.h
index 131e94b95e6..fc47b58640b 100644
--- a/docs/tutorials/002/handler.h
+++ b/docs/tutorials/002/handler.h
@@ -76,7 +76,7 @@ public:
virtual void destroy (void)
{
/* Remove ourselves from the reactor */
- g_reactor->remove_handler
+ g_reactor->remove_handler
(this,
ACE_Event_Handler::READ_MASK | ACE_Event_Handler::DONT_CALL);
diff --git a/docs/tutorials/002/page01.html b/docs/tutorials/002/page01.html
index 280bb0de807..7cb4d386b7b 100644
--- a/docs/tutorials/002/page01.html
+++ b/docs/tutorials/002/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/002/page02.html b/docs/tutorials/002/page02.html
index 3670c1851c2..ce7fa84eb39 100644
--- a/docs/tutorials/002/page02.html
+++ b/docs/tutorials/002/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -23,7 +24,7 @@ going to simplify the acceptor a great deal.
<P>
Kirthika's Abstract:
<UL>
-This is a server example made simpler due to the use of off-the-shelf
+This is a server example made simpler due to the use of off-the-shelf
components and classes from ACE.
<P>
Here, the Logging_Acceptor is an ACE_Acceptor class which is associated
@@ -47,10 +48,10 @@ underlying data stream passed to it.
<P>
A timer is scheduled in the reactor which does nothing but simply
display how it could be used to provide periodic processing when
-needed. The ACE_TimeValue is used to set the time period.
+needed. The ACE_TimeValue is used to set the time period.
<P>
Also, optimisations have been made in the form of a separate function
-for
+for
destroying the objects used.
<P>
Thus a simpler server has now been built which successfully
@@ -85,7 +86,7 @@ typedef ACE_Acceptor &lt;Logging_Handler, ACE_SOCK_ACCEPTOR> Logging_Acceptor;
<font color=red>/* One of the new things will be a signal handler so that we can exit
the application somewhat cleanly. The 'finished' flag is used
instead of the previous infninite loop and the 'handler' will set
- that flag in respose to SIGINT (CTRL-C).
+ that flag in respose to SIGINT (CTRL-C).
The invocation of <font color=#008888>ACE_Reactor::notify</font>() will cause the
handle_events() to return so that we can see the new value of 'finished'.
*/</font>
diff --git a/docs/tutorials/002/page03.html b/docs/tutorials/002/page03.html
index f06a3e5463f..a9c9959a7e5 100644
--- a/docs/tutorials/002/page03.html
+++ b/docs/tutorials/002/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -99,7 +100,7 @@ public:
virtual void destroy (void)
{
<font color=red>/* Remove ourselves from the reactor */</font>
- g_reactor->remove_handler
+ g_reactor->remove_handler
(this,
<font color=#008888>ACE_Event_Handler::READ_MASK</font> | ACE_Event_Handler::DONT_CALL);
diff --git a/docs/tutorials/002/page04.html b/docs/tutorials/002/page04.html
index 15a58015b48..0ed1165ef53 100644
--- a/docs/tutorials/002/page04.html
+++ b/docs/tutorials/002/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/002/server.cpp b/docs/tutorials/002/server.cpp
index 3066427c9cd..cfef3aa1a59 100644
--- a/docs/tutorials/002/server.cpp
+++ b/docs/tutorials/002/server.cpp
@@ -21,7 +21,7 @@ typedef ACE_Acceptor <Logging_Handler, ACE_SOCK_ACCEPTOR> Logging_Acceptor;
/* One of the new things will be a signal handler so that we can exit
the application somewhat cleanly. The 'finished' flag is used
instead of the previous infninite loop and the 'handler' will set
- that flag in respose to SIGINT (CTRL-C).
+ that flag in respose to SIGINT (CTRL-C).
The invocation of ACE_Reactor::notify() will cause the
handle_events() to return so that we can see the new value of 'finished'.
*/
diff --git a/docs/tutorials/003/client.cpp b/docs/tutorials/003/client.cpp
index dd21077f449..1c93769e7bd 100644
--- a/docs/tutorials/003/client.cpp
+++ b/docs/tutorials/003/client.cpp
@@ -11,7 +11,7 @@ static u_short SERVER_PORT = ACE_DEFAULT_SERVER_PORT;
static const char *const SERVER_HOST = ACE_DEFAULT_SERVER_HOST;
static const int MAX_ITERATIONS = 4;
-int
+int
main (int argc, char *argv[])
{
/* Accept the users's choice of hosts or use the default. Then do
@@ -47,7 +47,7 @@ main (int argc, char *argv[])
"%p\n",
"open"),
-1);
-
+
/* Just for grins, we'll send the server several messages. */
for (int i = 0; i < max_iterations; i++)
{
diff --git a/docs/tutorials/003/combine.shar b/docs/tutorials/003/combine.shar
index 7c5c12cd372..67aebd9b3fd 100644
--- a/docs/tutorials/003/combine.shar
+++ b/docs/tutorials/003/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-01-17 14:27 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/003'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/003'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -12,7 +12,7 @@
# length mode name
# ------ ---------- ------------------------------------------
# 607 -rw-rw-r-- hdr
-# 17 -rw-rw-r-- bodies
+# 18 -rw-rw-r-- bodies
# 1155 -rw-rw-r-- page01.pre
# 447 -rw-rw-r-- page01.pst
#
@@ -61,7 +61,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh00333; then
+if mkdir _sh04727; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -122,12 +122,12 @@ SHAR_EOF
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'bodies:' 'MD5 check failed'
-773a1437ce449e55856a43c0538ca5b2 bodies
+d02fcd98e57e40350f82497be4ac0e0c bodies
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'bodies'`"
- test 17 -eq "$shar_count" ||
- $echo 'bodies:' 'original size' '17,' 'current size' "$shar_count!"
+ test 18 -eq "$shar_count" ||
+ $echo 'bodies:' 'original size' '18,' 'current size' "$shar_count!"
fi
fi
# ============= page01.pre ==============
@@ -213,5 +213,5 @@ SHAR_EOF
$echo 'page01.pst:' 'original size' '447,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh00333
+rm -fr _sh04727
exit 0
diff --git a/docs/tutorials/003/page01.html b/docs/tutorials/003/page01.html
index abf72ebe40f..fcf34fa66db 100644
--- a/docs/tutorials/003/page01.html
+++ b/docs/tutorials/003/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -55,7 +56,7 @@ static u_short SERVER_PORT = ACE_DEFAULT_SERVER_PORT;
static const char *const SERVER_HOST = ACE_DEFAULT_SERVER_HOST;
static const int MAX_ITERATIONS = 4;
-int
+int
main (int argc, char *argv[])
{
<font color=red>/* Accept the users's choice of hosts or use the default. Then do
@@ -91,7 +92,7 @@ main (int argc, char *argv[])
"<font color=green>%p\n</font>",
"<font color=green>open</font>"),
-1);
-
+
<font color=red>/* Just for grins, we'll send the server several messages. */</font>
for (int i = 0; i &lt; max_iterations; i++)
{
diff --git a/docs/tutorials/004/client.cpp b/docs/tutorials/004/client.cpp
index c65a028f633..33bada96743 100644
--- a/docs/tutorials/004/client.cpp
+++ b/docs/tutorials/004/client.cpp
@@ -65,7 +65,7 @@ Client::Client (const char *server,
/* Open a connection to the server. This hides the use of
ACE_SOCK_Connector from our caller. Since our caller probably
doesn't care *how* we connect, this is a good thing. */
-int
+int
Client::open (const char *server,
u_short port)
{
@@ -86,7 +86,7 @@ Client::open (const char *server,
/* The first of our put operators sends a simple string object to the
peer. */
-Client &
+Client &
Client::operator<< (ACE_SString &str)
{
/* We have to be able to allow: server << foo << bar << stuff;
@@ -125,7 +125,7 @@ more efficient to implement this with the body of the
operator<<(ACE_SString&) method and then express that method in terms
of this one. There's always more than one way to do things! */
-Client &
+Client &
Client::operator<< (char *str)
{
ACE_SString newStr (str);
@@ -146,7 +146,7 @@ Client::operator<< (char *str)
Do the same thing we did with char* and convert it to ACE_SString
where we already have a << operator defined. */
-Client &
+Client &
Client::operator<< (int n)
{
/* Create a character buffer large enough for the largest number.
@@ -170,7 +170,7 @@ Client::operator<< (int n)
/* Now we pull it all together. Like Tutorial 3, we'll allow command
line options. */
-int
+int
main (int argc, char *argv[])
{
const char *server_host = argc > 1 ? argv[1] : ACE_DEFAULT_SERVER_HOST;
@@ -179,7 +179,7 @@ main (int argc, char *argv[])
/* Use the basic constructor since the other isn't really very safe. */
Client peer;
-
+
/* Open the server connection. Notice how this is simpler than
Tutorial 3 since we only have to provide a host name and port
value. */
@@ -189,7 +189,7 @@ main (int argc, char *argv[])
"%p\n",
"open"),
-1);
-
+
for (int i = 0; i < max_iterations; i++)
{
/* Tell the server which iteration we're on. No more mucking
diff --git a/docs/tutorials/004/combine.shar b/docs/tutorials/004/combine.shar
index ae15fa1d7d7..ba958b2fa14 100644
--- a/docs/tutorials/004/combine.shar
+++ b/docs/tutorials/004/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-01-24 11:50 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/004'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/004'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -61,7 +61,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh21744; then
+if mkdir _sh04745; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -212,5 +212,5 @@ SHAR_EOF
$echo 'page01.pst:' 'original size' '961,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh21744
+rm -fr _sh04745
exit 0
diff --git a/docs/tutorials/004/page01.html b/docs/tutorials/004/page01.html
index 12dd8716949..28a5479c80c 100644
--- a/docs/tutorials/004/page01.html
+++ b/docs/tutorials/004/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -26,7 +27,7 @@ Kirthika says:
<UL>
The cool thing about this "cooler" client is how we use a C++ trick for
streaming incoming data by using the operator<<() method. Also the
-Connector portion is wrapped in the open() method which now takes in the
+Connector portion is wrapped in the open() method which now takes in the
server hostname and port. The result is a cleaner looking client which
successfully interacts with the server when connection is established.
</UL>
@@ -99,7 +100,7 @@ protected:
<font color=red>/* Open a connection to the server. This hides the use of
ACE_SOCK_Connector from our caller. Since our caller probably
doesn't care *how* we connect, this is a good thing. */</font>
-int
+int
<font color=#008888>Client::open</font> (const char *server,
u_short port)
{
@@ -120,7 +121,7 @@ int
<font color=red>/* The first of our put operators sends a simple string object to the
peer. */</font>
-Client &
+Client &
<font color=#008888>Client::operator</font>&lt;&lt; (ACE_SString &str)
{
<font color=red>/* We have to be able to allow: server &lt;&lt; foo &lt;&lt; bar &lt;&lt; stuff;
@@ -159,7 +160,7 @@ more efficient to implement this with the body of the
operator&lt;&lt;(ACE_SString&) method and then express that method in terms
of this one. There's always more than one way to do things! */</font>
-Client &
+Client &
<font color=#008888>Client::operator</font>&lt;&lt; (char *str)
{
ACE_SString newStr (str);
@@ -180,7 +181,7 @@ Client &
Do the same thing we did with char* and convert it to ACE_SString
where we already have a &lt;&lt; operator defined. */</font>
-Client &
+Client &
<font color=#008888>Client::operator</font>&lt;&lt; (int n)
{
<font color=red>/* Create a character buffer large enough for the largest number.
@@ -204,7 +205,7 @@ Client &
<font color=red>/* Now we pull it all together. Like Tutorial 3, we'll allow command
line options. */</font>
-int
+int
main (int argc, char *argv[])
{
const char *server_host = argc > 1 ? argv[1] : ACE_DEFAULT_SERVER_HOST;
@@ -213,7 +214,7 @@ main (int argc, char *argv[])
<font color=red>/* Use the basic constructor since the other isn't really very safe. */</font>
Client peer;
-
+
<font color=red>/* Open the server connection. Notice how this is simpler than
Tutorial 3 since we only have to provide a host name and port
value. */</font>
@@ -223,7 +224,7 @@ main (int argc, char *argv[])
"<font color=green>%p\n</font>",
"<font color=green>open</font>"),
-1);
-
+
for (int i = 0; i &lt; max_iterations; i++)
{
<font color=red>/* Tell the server which iteration we're on. No more mucking
@@ -254,9 +255,9 @@ main (int argc, char *argv[])
so hard to create an object that makes sending data much more "natural"
than the typical send() or send_n() invocation. You can even build
up arbitrary objects and do some neat tricks with C++ templates to stream
-their data out as well. (We may go into that a little later.)
+their data out as well. (We may go into that a little later.)
Of course, writting the full implementation such that these streams are
-interchangable with the standard C++ ostreams is quite a bit more difficult.
+interchangable with the standard C++ ostreams is quite a bit more difficult.
In addition, there are a lot of optimizations that this client would benefit
from!
diff --git a/docs/tutorials/005/client_handler.cpp b/docs/tutorials/005/client_handler.cpp
index 8466992b6a0..05ed4055a98 100644
--- a/docs/tutorials/005/client_handler.cpp
+++ b/docs/tutorials/005/client_handler.cpp
@@ -41,7 +41,7 @@ Client_Handler::~Client_Handler (void)
should return int so that it can tell the caller there was a
problem. Even as void you could at least throw an exception which
you would never want to do in a destructor. */
-void
+void
Client_Handler::destroy (void)
{
/* Tell the reactor to forget all about us. Notice that we use the
@@ -62,7 +62,7 @@ Client_Handler::destroy (void)
Client_Acceptor when a new client connection has been accepted.
The Client_Acceptor instance pointer is cast to a void* and given
to us here. We'll use that to avoid some global data... */
-int
+int
Client_Handler::open (void *_acceptor)
{
/* Convert the void* to a Client_Acceptor*. You should probably use
@@ -132,7 +132,7 @@ Client_Handler::open (void *_acceptor)
As I mentioned, the _handle parameter isn't useful to us but it
narrows the list of methods the reactor has to worry about and the
list of possible virtual functions we would have to override. */
-int
+int
Client_Handler::handle_input (ACE_HANDLE handle)
{
/* Some compilers don't like it when you fail to use a parameter.
@@ -158,7 +158,7 @@ Client_Handler::handle_input (ACE_HANDLE handle)
framework will take care of removing us (due to the -1), so we
don't need to use the destroy() method. Instead, we just delete
ourselves directly. */
-int
+int
Client_Handler::handle_close (ACE_HANDLE handle,
ACE_Reactor_Mask mask)
{
@@ -176,7 +176,7 @@ Client_Handler::handle_close (ACE_HANDLE handle,
appliation, you will probably have a bit more in main() to deal
with command line options but after that point, all of the action
takes place here. */
-int
+int
Client_Handler::process (char *rdbuf,
int rdbuf_len)
{
diff --git a/docs/tutorials/005/client_handler.h b/docs/tutorials/005/client_handler.h
index 4a579110a6b..03d3b1a8e10 100644
--- a/docs/tutorials/005/client_handler.h
+++ b/docs/tutorials/005/client_handler.h
@@ -65,7 +65,7 @@ public:
side-effect, the reactor will also invoke remove_handler() for the
object on the mask that caused the -1 return. This means that we
don't have to do that ourselves! */
- int handle_close (ACE_HANDLE handle,
+ int handle_close (ACE_HANDLE handle,
ACE_Reactor_Mask mask);
protected:
diff --git a/docs/tutorials/005/combine.shar b/docs/tutorials/005/combine.shar
index 28175d7785e..fd84e424b0c 100644
--- a/docs/tutorials/005/combine.shar
+++ b/docs/tutorials/005/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-01-24 14:30 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/005'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/005'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -67,7 +67,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh22890; then
+if mkdir _sh04765; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -419,5 +419,5 @@ SHAR_EOF
$echo 'page08.pre:' 'original size' '715,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh22890
+rm -fr _sh04765
exit 0
diff --git a/docs/tutorials/005/page01.html b/docs/tutorials/005/page01.html
index 90a5da1e1f4..8f465378ea0 100644
--- a/docs/tutorials/005/page01.html
+++ b/docs/tutorials/005/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/005/page02.html b/docs/tutorials/005/page02.html
index 2a3e4b143de..8cc6ec849cc 100644
--- a/docs/tutorials/005/page02.html
+++ b/docs/tutorials/005/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -25,7 +26,7 @@ This tutorial is a re-cap of the client-server hookup tutorial with much
process() which does the task of reading in data from the client).
<P>
We again enroll the services of the ACE_Reactor to handle events. Everything
-occurs in a single thread.
+occurs in a single thread.
<P>
This tutorial is a stepping stone towards a mutithreaded server model.
</ul>
@@ -67,7 +68,7 @@ static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
though we're not going to use the parameters, we still have to
specify them. */</font>
-int
+int
main (int argc, char *argv[])
{
<font color=red>/* In our earlier servers, we used a global pointer to get to the
@@ -132,7 +133,7 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG,
"<font color=green>(%P|%t) shutting down server daemon\n</font>"));
-
+
return 0;
}
diff --git a/docs/tutorials/005/page03.html b/docs/tutorials/005/page03.html
index c190dfe9839..62982e8bc33 100644
--- a/docs/tutorials/005/page03.html
+++ b/docs/tutorials/005/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/005/page04.html b/docs/tutorials/005/page04.html
index fb670bbe7a3..c349fd2d118 100644
--- a/docs/tutorials/005/page04.html
+++ b/docs/tutorials/005/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -95,7 +96,7 @@ public:
side-effect, the reactor will also invoke remove_handler() for the
object on the mask that caused the -1 return. This means that we
don't have to do that ourselves! */</font>
- int handle_close (ACE_HANDLE handle,
+ int handle_close (ACE_HANDLE handle,
ACE_Reactor_Mask mask);
protected:
diff --git a/docs/tutorials/005/page05.html b/docs/tutorials/005/page05.html
index 388a421eff6..d354405aa3c 100644
--- a/docs/tutorials/005/page05.html
+++ b/docs/tutorials/005/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -66,7 +67,7 @@ rest of the application all together.
should return int so that it can tell the caller there was a
problem. Even as void you could at least throw an exception which
you would never want to do in a destructor. */</font>
-void
+void
<font color=#008888>Client_Handler::destroy</font> (void)
{
<font color=red>/* Tell the reactor to forget all about us. Notice that we use the
@@ -87,7 +88,7 @@ void
Client_Acceptor when a new client connection has been accepted.
The Client_Acceptor instance pointer is cast to a void* and given
to us here. We'll use that to avoid some global data... */</font>
-int
+int
<font color=#008888>Client_Handler::open</font> (void *_acceptor)
{
<font color=red>/* Convert the void* to a Client_Acceptor*. You should probably use
@@ -157,7 +158,7 @@ int
As I mentioned, the _handle parameter isn't useful to us but it
narrows the list of methods the reactor has to worry about and the
list of possible virtual functions we would have to override. */</font>
-int
+int
<font color=#008888>Client_Handler::handle_input</font> (ACE_HANDLE handle)
{
<font color=red>/* Some compilers don't like it when you fail to use a parameter.
@@ -183,7 +184,7 @@ int
framework will take care of removing us (due to the -1), so we
don't need to use the destroy() method. Instead, we just delete
ourselves directly. */</font>
-int
+int
<font color=#008888>Client_Handler::handle_close</font> (ACE_HANDLE handle,
ACE_Reactor_Mask mask)
{
@@ -201,7 +202,7 @@ int
appliation, you will probably have a bit more in main() to deal
with command line options but after that point, all of the action
takes place here. */</font>
-int
+int
<font color=#008888>Client_Handler::process</font> (char *rdbuf,
int rdbuf_len)
{
diff --git a/docs/tutorials/005/page06.html b/docs/tutorials/005/page06.html
index 9fbe678e023..4f390a4ceb2 100644
--- a/docs/tutorials/005/page06.html
+++ b/docs/tutorials/005/page06.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -41,7 +42,7 @@ BIN = server
# Few applications will have a single source file. We use the FILES
# macro to build up a list of additional files to compile. Notice
# that we leave off the extension just as with BIN
-FILES =
+FILES =
FILES += client_handler
# The BUILD macro is used by the ACE makefiles. Basically, it tells
@@ -107,7 +108,7 @@ Indent : #
<font color=blue># include</font> just like the makefile components above.
#
# NOTE: The 'depend' target expects to have GCC available.
- # You can do the same thing with other compilers but the ACE
+ # You can do the same thing with other compilers but the ACE
# makefiles and utilities are only wired up to work with GCC.
Depend : depend
perl ../fix.Makefile
@@ -122,13 +123,13 @@ HTML : #
SHAR : #
[ ! -f combine.shar ] || exit 1
- shar -T hdr bodies *.pre > combine.shar && rm -f hdr bodies *.pre *.pst
+ shar -T hdr bodies *.pre > combine.shar && $(RM) hdr bodies *.pre *.pst
UNSHAR : #
sh combine.shar
CLEAN : realclean
- rm -f hdr bodies *.pre *.pst .depend
+ $(RM) hdr bodies *.pre *.pst .depend
#----------------------------------------------------------------------------
# Dependencies
diff --git a/docs/tutorials/005/page07.html b/docs/tutorials/005/page07.html
index 3a7433dbd34..84768e05b96 100644
--- a/docs/tutorials/005/page07.html
+++ b/docs/tutorials/005/page07.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/005/page08.html b/docs/tutorials/005/page08.html
index db7acc3f76b..07ba9a41ed9 100644
--- a/docs/tutorials/005/page08.html
+++ b/docs/tutorials/005/page08.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/005/server.cpp b/docs/tutorials/005/server.cpp
index 00f2f6778ae..186098679fb 100644
--- a/docs/tutorials/005/server.cpp
+++ b/docs/tutorials/005/server.cpp
@@ -33,7 +33,7 @@ static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
though we're not going to use the parameters, we still have to
specify them. */
-int
+int
main (int argc, char *argv[])
{
/* In our earlier servers, we used a global pointer to get to the
@@ -98,7 +98,7 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) shutting down server daemon\n"));
-
+
return 0;
}
diff --git a/docs/tutorials/006/client_acceptor.h b/docs/tutorials/006/client_acceptor.h
index 443cae34c8f..4a50de72952 100644
--- a/docs/tutorials/006/client_acceptor.h
+++ b/docs/tutorials/006/client_acceptor.h
@@ -63,8 +63,8 @@ public:
Client_Handler to decide how to act. If 'true' then the handler
will behave in a thread-per-connection manner. */
int thread_per_connection (void)
- {
- return this->thread_per_connection_;
+ {
+ return this->thread_per_connection_;
}
protected:
diff --git a/docs/tutorials/006/client_handler.cpp b/docs/tutorials/006/client_handler.cpp
index 584013e50c8..9ea01d64cda 100644
--- a/docs/tutorials/006/client_handler.cpp
+++ b/docs/tutorials/006/client_handler.cpp
@@ -37,7 +37,7 @@ Client_Handler::~Client_Handler (void)
should return int so that it can tell the caller there was a
problem. Even as void you could at least throw an exception which
you would never want to do in a destructor. */
-void
+void
Client_Handler::destroy (void)
{
/* Tell the reactor to forget all about us. Notice that we use the
@@ -46,7 +46,7 @@ Client_Handler::destroy (void)
handle_close() being called. Since we likely got here due to
handle_close(), that could cause a bit of nasty recursion! */
this->reactor ()->remove_handler (this,
- ACE_Event_Handler::READ_MASK
+ ACE_Event_Handler::READ_MASK
| ACE_Event_Handler::DONT_CALL);
/* This is how we're able to tell folks not to use delete. By
@@ -59,7 +59,7 @@ Client_Handler::destroy (void)
Client_Acceptor when a new client connection has been accepted.
The Client_Acceptor instance pointer is cast to a void* and given
to us here. We'll use that to avoid some global data... */
-int
+int
Client_Handler::open (void *void_acceptor)
{
/* We need this to store the address of the client that we are now
@@ -148,7 +148,7 @@ Client_Handler::open (void *void_acceptor)
threaded context is to invoke it's close() method. Since we
already have a handle_close() method built to cleanup after us,
we'll just forward the request on to that object. */
-int
+int
Client_Handler::close(u_long flags)
{
ACE_UNUSED_ARG (flags);
@@ -173,7 +173,7 @@ Client_Handler::close(u_long flags)
list of possible virtual functions we would have to override.
Again, this is not used if we're in thread-per-connection mode. */
-int
+int
Client_Handler::handle_input (ACE_HANDLE handle)
{
/* Some compilers don't like it when you fail to use a parameter.
@@ -199,7 +199,7 @@ Client_Handler::handle_input (ACE_HANDLE handle)
framework will take care of removing us (due to the -1), so we
don't need to use the destroy() method. Instead, we just delete
ourselves directly. */
-int
+int
Client_Handler::handle_close (ACE_HANDLE handle,
ACE_Reactor_Mask mask)
{
@@ -219,7 +219,7 @@ Client_Handler::handle_close (ACE_HANDLE handle,
Of course, this is only valid if we're in thread-per-connection
mode. If we're using the reactor model, then svc() never comes
into play. */
-int
+int
Client_Handler::svc(void)
{
/* Like handle_input(), we create a buffer for loading the data.
@@ -256,7 +256,7 @@ Client_Handler::svc(void)
appliation, you will probably have a bit more in main() to deal
with command line options but after that point, all of the action
takes place here. */
-int
+int
Client_Handler::process (char *rdbuf,
int rdbuf_len)
{
@@ -272,7 +272,7 @@ Client_Handler::process (char *rdbuf,
switch (this->peer ().recv (rdbuf, rdbuf_len))
{
case -1:
- ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_ERROR_RETURN ((LM_ERROR,
"(%P|%t) %p bad read\n",
"client"),
-1);
diff --git a/docs/tutorials/006/combine.shar b/docs/tutorials/006/combine.shar
index 41392122821..48385d7b563 100644
--- a/docs/tutorials/006/combine.shar
+++ b/docs/tutorials/006/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-01-18 20:31 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/006'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/006'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -13,7 +13,7 @@
# ------ ---------- ------------------------------------------
# 605 -rw-rw-r-- hdr
# 72 -rw-rw-r-- bodies
-# 1973 -rw-rw-r-- page01.pre
+# 1974 -rw-rw-r-- page01.pre
# 252 -rw-rw-r-- page02.pre
# 507 -rw-rw-r-- page03.pre
# 227 -rw-rw-r-- page04.pre
@@ -22,7 +22,7 @@
# 89 -rw-rw-r-- page02.pst
# 168 -rw-rw-r-- page03.pst
# 175 -rw-rw-r-- page04.pst
-# 528 -rw-rw-r-- page05.pst
+# 1420 -rw-rw-r-- page05.pst
#
save_IFS="${IFS}"
IFS="${IFS}:"
@@ -69,7 +69,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh23703; then
+if mkdir _sh04795; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -197,12 +197,12 @@ SHAR_EOF
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page01.pre:' 'MD5 check failed'
-c4255ba9e01891294697e95d6edbc326 page01.pre
+b66014851d6db1c8d89a07d024be2ecb page01.pre
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page01.pre'`"
- test 1973 -eq "$shar_count" ||
- $echo 'page01.pre:' 'original size' '1973,' 'current size' "$shar_count!"
+ test 1974 -eq "$shar_count" ||
+ $echo 'page01.pre:' 'original size' '1974,' 'current size' "$shar_count!"
fi
fi
# ============= page02.pre ==============
@@ -460,6 +460,22 @@ else
$echo 'x -' extracting 'page05.pst' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'page05.pst' &&
<HR WIDTH="100%">
+<P>
+X Did you notice the <i>THR_DETACHED</i> flag on the call to
+X <i>activate()</i>? Threads, like any system resource, are a
+X limited resource. Unless we intend to <i>join()</i> or
+X <i>wait()</i> for the new thread later, we want use THR_DETACHED
+X so that we don't cause a leak. In fact, in most cases, you'll
+X want to specify THR_DETACHED because it's just easier.
+<p>
+X Another handy flag for use with <i>activate()</i> is
+X <i>THR_NEW_LWP</i>. That's short for <i>Light Weight
+X Process</i>. If you've got a multiprocessor, this flag will
+X allocate a new schedulable process and decrease the odds of your
+X threads all fighting for the same process. Of course, if you
+X have a uni-processor, it will neither help nor hurt. Since I
+X developed these on a uni-processor, I've been a bit inconsistent
+X in the use of <i>THR_NEW_LWP</i>.
X
<P>Well, that's it!&nbsp; After all the talk &amp; the hype, you would
have expected it to be more difficult to create a multi-threaded server.&nbsp;
@@ -473,20 +489,20 @@ X
X
<P>
SHAR_EOF
- $shar_touch -am 0118202399 'page05.pst' &&
+ $shar_touch -am 0921222699 'page05.pst' &&
chmod 0664 'page05.pst' ||
$echo 'restore of' 'page05.pst' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page05.pst:' 'MD5 check failed'
-c09a518d674612c988d52bba9333a943 page05.pst
+fab2e03eb2f115f89a58d70be291e87e page05.pst
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page05.pst'`"
- test 528 -eq "$shar_count" ||
- $echo 'page05.pst:' 'original size' '528,' 'current size' "$shar_count!"
+ test 1420 -eq "$shar_count" ||
+ $echo 'page05.pst:' 'original size' '1420,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh23703
+rm -fr _sh04795
exit 0
diff --git a/docs/tutorials/006/page01.html b/docs/tutorials/006/page01.html
index 31380d02b6d..3ff14911f04 100644
--- a/docs/tutorials/006/page01.html
+++ b/docs/tutorials/006/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -34,10 +35,10 @@ The ACE_Acceptor inherits form the ACE_Acceptor_Base class which
facilitates us to implement various different concurrency strategies
depending on whether the server is single-threaded or the server creates
a new thread per connection. This also allows us to extend the
-capabilities of the server in the future by implementing a different
+capabilities of the server in the future by implementing a different
strategy.
<p>
-This information is passed on to the Client_Handler
+This information is passed on to the Client_Handler
(remember ACE_Acceptor < Client_Handler, ACE_SOCK_ACCEPTOR > ?).
The Client_Handler is an ACE_Svc_Handler as the Svc_Handler is a
derivative of the Event_Handler and is associated with
@@ -54,7 +55,7 @@ reponsible for that client connection now takes up the job of the
reactor and handles future events.
<p>
Thus a simple, thread-per-connection server has been built which doesnt
-delve too deeply into mutli-threading issues.
+delve too deeply into mutli-threading issues.
</ul>
<font size=-1>* Abstract by Kirthika as always</font>
<P><HR WIDTH="100%">
diff --git a/docs/tutorials/006/page02.html b/docs/tutorials/006/page02.html
index be0b111a071..e56c466767d 100644
--- a/docs/tutorials/006/page02.html
+++ b/docs/tutorials/006/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -57,7 +58,7 @@ static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
though we're not going to use the parameters, we still have to
specify them. */</font>
-int
+int
main (int argc, char *argv[])
{
<font color=red>/* In our earlier servers, we used a global pointer to get to the
@@ -103,7 +104,7 @@ main (int argc, char *argv[])
<font color=red>/* Like ACE_ERROR_RETURN, the ACE_DEBUG macro gets used quite a bit.
It's a handy way to generate uniform debug output from your
program. */</font>
- ACE_DEBUG ((LM_DEBUG,
+ ACE_DEBUG ((LM_DEBUG,
"<font color=green>(%P|%t) starting up server daemon\n</font>"));
<font color=red>/* This will loop "<font color=green>forever</font>" invoking the handle_events() method of
diff --git a/docs/tutorials/006/page03.html b/docs/tutorials/006/page03.html
index e5616cb514b..1c202720321 100644
--- a/docs/tutorials/006/page03.html
+++ b/docs/tutorials/006/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -91,8 +92,8 @@ public:
Client_Handler to decide how to act. If 'true' then the handler
will behave in a thread-per-connection manner. */</font>
int thread_per_connection (void)
- {
- return this->thread_per_connection_;
+ {
+ return this->thread_per_connection_;
}
protected:
diff --git a/docs/tutorials/006/page04.html b/docs/tutorials/006/page04.html
index caa8c2f0bed..a43304af2e4 100644
--- a/docs/tutorials/006/page04.html
+++ b/docs/tutorials/006/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/006/page05.html b/docs/tutorials/006/page05.html
index 389ae8e716e..af803d9a54a 100644
--- a/docs/tutorials/006/page05.html
+++ b/docs/tutorials/006/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -61,7 +62,7 @@ made in open() as well as the bit of cleverness in svc().
should return int so that it can tell the caller there was a
problem. Even as void you could at least throw an exception which
you would never want to do in a destructor. */</font>
-void
+void
<font color=#008888>Client_Handler::destroy</font> (void)
{
<font color=red>/* Tell the reactor to forget all about us. Notice that we use the
@@ -70,7 +71,7 @@ void
handle_close() being called. Since we likely got here due to
handle_close(), that could cause a bit of nasty recursion! */</font>
this->reactor ()->remove_handler (this,
- <font color=#008888>ACE_Event_Handler::READ_MASK</font>
+ <font color=#008888>ACE_Event_Handler::READ_MASK</font>
| <font color=#008888>ACE_Event_Handler::DONT_CALL</font>);
<font color=red>/* This is how we're able to tell folks not to use delete. By
@@ -83,7 +84,7 @@ void
Client_Acceptor when a new client connection has been accepted.
The Client_Acceptor instance pointer is cast to a void* and given
to us here. We'll use that to avoid some global data... */</font>
-int
+int
<font color=#008888>Client_Handler::open</font> (void *void_acceptor)
{
<font color=red>/* We need this to store the address of the client that we are now
@@ -172,7 +173,7 @@ int
threaded context is to invoke it's close() method. Since we
already have a handle_close() method built to cleanup after us,
we'll just forward the request on to that object. */</font>
-int
+int
<font color=#008888>Client_Handler::close</font>(u_long flags)
{
ACE_UNUSED_ARG (flags);
@@ -197,7 +198,7 @@ int
list of possible virtual functions we would have to override.
Again, this is not used if we're in thread-per-connection mode. */</font>
-int
+int
<font color=#008888>Client_Handler::handle_input</font> (ACE_HANDLE handle)
{
<font color=red>/* Some compilers don't like it when you fail to use a parameter.
@@ -223,7 +224,7 @@ int
framework will take care of removing us (due to the -1), so we
don't need to use the destroy() method. Instead, we just delete
ourselves directly. */</font>
-int
+int
<font color=#008888>Client_Handler::handle_close</font> (ACE_HANDLE handle,
ACE_Reactor_Mask mask)
{
@@ -243,7 +244,7 @@ int
Of course, this is only valid if we're in thread-per-connection
mode. If we're using the reactor model, then svc() never comes
into play. */</font>
-int
+int
<font color=#008888>Client_Handler::svc</font>(void)
{
<font color=red>/* Like handle_input(), we create a buffer for loading the data.
@@ -280,7 +281,7 @@ int
appliation, you will probably have a bit more in main() to deal
with command line options but after that point, all of the action
takes place here. */</font>
-int
+int
<font color=#008888>Client_Handler::process</font> (char *rdbuf,
int rdbuf_len)
{
@@ -296,7 +297,7 @@ int
switch (this->peer ().recv (rdbuf, rdbuf_len))
{
case -1:
- ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_ERROR_RETURN ((LM_ERROR,
"<font color=green>(%P|%t) %p bad read\n</font>",
"<font color=green>client</font>"),
-1);
@@ -315,6 +316,22 @@ int
}
</PRE>
<HR WIDTH="100%">
+<P>
+ Did you notice the <i>THR_DETACHED</i> flag on the call to
+ <i>activate()</i>? Threads, like any system resource, are a
+ limited resource. Unless we intend to <i>join()</i> or
+ <i>wait()</i> for the new thread later, we want use THR_DETACHED
+ so that we don't cause a leak. In fact, in most cases, you'll
+ want to specify THR_DETACHED because it's just easier.
+<p>
+ Another handy flag for use with <i>activate()</i> is
+ <i>THR_NEW_LWP</i>. That's short for <i>Light Weight
+ Process</i>. If you've got a multiprocessor, this flag will
+ allocate a new schedulable process and decrease the odds of your
+ threads all fighting for the same process. Of course, if you
+ have a uni-processor, it will neither help nor hurt. Since I
+ developed these on a uni-processor, I've been a bit inconsistent
+ in the use of <i>THR_NEW_LWP</i>.
<P>Well, that's it!&nbsp; After all the talk &amp; the hype, you would
have expected it to be more difficult to create a multi-threaded server.&nbsp;
diff --git a/docs/tutorials/006/page06.html b/docs/tutorials/006/page06.html
index 041042b8aec..522318b436c 100644
--- a/docs/tutorials/006/page06.html
+++ b/docs/tutorials/006/page06.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/006/server.cpp b/docs/tutorials/006/server.cpp
index 3d324960a52..fd3a18d9d28 100644
--- a/docs/tutorials/006/server.cpp
+++ b/docs/tutorials/006/server.cpp
@@ -33,7 +33,7 @@ static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
though we're not going to use the parameters, we still have to
specify them. */
-int
+int
main (int argc, char *argv[])
{
/* In our earlier servers, we used a global pointer to get to the
@@ -79,7 +79,7 @@ main (int argc, char *argv[])
/* Like ACE_ERROR_RETURN, the ACE_DEBUG macro gets used quite a bit.
It's a handy way to generate uniform debug output from your
program. */
- ACE_DEBUG ((LM_DEBUG,
+ ACE_DEBUG ((LM_DEBUG,
"(%P|%t) starting up server daemon\n"));
/* This will loop "forever" invoking the handle_events() method of
diff --git a/docs/tutorials/007/client_acceptor.cpp b/docs/tutorials/007/client_acceptor.cpp
index 14794c2c290..079ae8e6d6a 100644
--- a/docs/tutorials/007/client_acceptor.cpp
+++ b/docs/tutorials/007/client_acceptor.cpp
@@ -32,7 +32,7 @@ Client_Acceptor::~Client_Acceptor (void)
Notice how we delegate most of the open() work to the open() method
of our baseclass. */
-int
+int
Client_Acceptor::open (const ACE_INET_Addr &addr,
ACE_Reactor *reactor,
int pool_size)
@@ -45,7 +45,7 @@ Client_Acceptor::open (const ACE_INET_Addr &addr,
/* Here again we find that we have to manage the thread pool. Like
open() we also delegate the other work to our baseclass. */
-int
+int
Client_Acceptor::close (void)
{
if (this->concurrency() == thread_pool_ && thread_pool_is_private ())
diff --git a/docs/tutorials/007/client_acceptor.h b/docs/tutorials/007/client_acceptor.h
index f187aa34f5a..fb591f548fb 100644
--- a/docs/tutorials/007/client_acceptor.h
+++ b/docs/tutorials/007/client_acceptor.h
@@ -92,7 +92,7 @@ public:
/* What is our concurrency strategy? */
int concurrency (void)
- {
+ {
return this->concurrency_;
}
@@ -102,7 +102,7 @@ public:
globally accessible thread pool. ACE_Singleton<> is a way to
achieve that. */
Thread_Pool *thread_pool (void)
- {
+ {
return &this->the_thread_pool_;
}
@@ -110,8 +110,8 @@ public:
are times when we need to know if the thread pool we're using is
ours or if we're just borrowing it from somebody else. */
int thread_pool_is_private (void)
- {
- return &the_thread_pool_ == &private_thread_pool_;
+ {
+ return &the_thread_pool_ == &private_thread_pool_;
}
protected:
diff --git a/docs/tutorials/007/client_handler.cpp b/docs/tutorials/007/client_handler.cpp
index 60b743d8de1..02ac8590a80 100644
--- a/docs/tutorials/007/client_handler.cpp
+++ b/docs/tutorials/007/client_handler.cpp
@@ -31,14 +31,14 @@ Client_Handler::~Client_Handler (void)
/* Query our acceptor for the concurrency strategy. Notice that we
don't bother to check that our acceptor pointer is valid. That is
proably a bad idea... */
-int
+int
Client_Handler::concurrency(void)
{
return this->client_acceptor ()->concurrency ();
}
/* And here we ask the acceptor about the thread pool. */
-Thread_Pool *
+Thread_Pool *
Client_Handler::thread_pool (void)
{
return this->client_acceptor ()->thread_pool ();
@@ -46,13 +46,13 @@ Client_Handler::thread_pool (void)
/* Back to our open() method. This is straight out of Tutorial 6.
There's nothing additional here for the thread-pool implementation. */
-int
+int
Client_Handler::open (void *acceptor)
{
client_acceptor ((Client_Acceptor *) acceptor);
if (concurrency () == Client_Acceptor::thread_per_connection_)
- return this->activate ();
+ return this->activate (THR_DETACHED);
this->reactor (client_acceptor()->reactor ());
@@ -76,7 +76,7 @@ Client_Handler::open (void *acceptor)
/* The destroy() method will remove us from the reactor (with the
DONT_CALL flag set!) and then free our memory. This allows us to
be closed from outside of the reactor context without any danger. */
-void
+void
Client_Handler::destroy (void)
{
this->reactor ()->remove_handler (this, REMOVE_MASK);
@@ -85,7 +85,7 @@ Client_Handler::destroy (void)
/* As mentioned in the header, the typical way to close an object in a
threaded context is to invoke it's close() method. */
-int
+int
Client_Handler::close (u_long flags)
{
/*
@@ -94,7 +94,7 @@ Client_Handler::close (u_long flags)
freeing our memory.
*/
this->destroy ();
-
+
/* Don't forward the close() to the baseclass! handle_close() above
has already taken care of delete'ing. Forwarding close() would
cause that to happen again and things would get really ugly at
@@ -104,7 +104,7 @@ Client_Handler::close (u_long flags)
/* We will be called when handle_input() returns -1. That's our queue
to delete ourselves to prevent memory leaks. */
-int
+int
Client_Handler::handle_close (ACE_HANDLE handle,
ACE_Reactor_Mask mask)
{
@@ -112,7 +112,7 @@ Client_Handler::handle_close (ACE_HANDLE handle,
ACE_UNUSED_ARG (mask);
delete this;
-
+
return 0;
}
@@ -129,7 +129,7 @@ Client_Handler::handle_close (ACE_HANDLE handle,
that case, we arrange to be put into the thread pool. If we're not
in the creator thread then we must be in the thread pool and we can
do some work. */
-int
+int
Client_Handler::handle_input (ACE_HANDLE handle)
{
ACE_UNUSED_ARG (handle);
@@ -187,7 +187,7 @@ Client_Handler::handle_input (ACE_HANDLE handle)
/* Remember that when we leave our svc() method, the framework will
take care of calling our close() method so that we can cleanup
after ourselves. */
-int
+int
Client_Handler::svc (void)
{
char buf[BUFSIZ];
@@ -203,7 +203,7 @@ Client_Handler::svc (void)
all affected by our choice of threading models. Of course, I'm not
sharing data between threads or anything. We'll leave locking
issues for a later tutorial. */
-int
+int
Client_Handler::process (char *rdbuf,
int rdbuf_len)
{
diff --git a/docs/tutorials/007/client_handler.h b/docs/tutorials/007/client_handler.h
index b2a43106dc8..9bb4af24358 100644
--- a/docs/tutorials/007/client_handler.h
+++ b/docs/tutorials/007/client_handler.h
@@ -119,16 +119,16 @@ protected:
for information. It is generally a good idea to do that through
an accesor rather than using the member variable directly. */
Client_Acceptor *client_acceptor (void)
- {
- return this->client_acceptor_;
+ {
+ return this->client_acceptor_;
}
/* And since you shouldn't access a member variable directly,
neither should you set (mutate) it. Although it might seem silly
to do it this way, you'll thank yourself for it later. */
void client_acceptor (Client_Acceptor *_client_acceptor)
- {
- this->client_acceptor_ = _client_acceptor;
+ {
+ this->client_acceptor_ = _client_acceptor;
}
/* The concurrency() accessor tells us the current concurrency
diff --git a/docs/tutorials/007/combine.shar b/docs/tutorials/007/combine.shar
index 3c01098a177..e6683a9d025 100644
--- a/docs/tutorials/007/combine.shar
+++ b/docs/tutorials/007/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-01-24 15:37 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/007'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/007'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -13,14 +13,14 @@
# ------ ---------- ------------------------------------------
# 576 -rw-rw-r-- hdr
# 123 -rw-rw-r-- bodies
-# 3385 -rw-rw-r-- page01.pre
+# 3386 -rw-rw-r-- page01.pre
# 87 -rw-rw-r-- page02.pre
# 120 -rw-rw-r-- page03.pre
# 171 -rw-rw-r-- page04.pre
# 105 -rw-rw-r-- page05.pre
# 160 -rw-rw-r-- page06.pre
# 340 -rw-rw-r-- page07.pre
-# 135 -rw-rw-r-- page08.pre
+# 378 -rw-rw-r-- page08.pre
# 2071 -rw-rw-r-- page09.pre
# 173 -rw-rw-r-- page02.pst
# 116 -rw-rw-r-- page03.pst
@@ -74,7 +74,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh24460; then
+if mkdir _sh04829; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -227,12 +227,12 @@ SHAR_EOF
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page01.pre:' 'MD5 check failed'
-555176fa726c723dda37c4256f29165b page01.pre
+b38f0bc755d9398afbf71fd8261fdb9b page01.pre
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page01.pre'`"
- test 3385 -eq "$shar_count" ||
- $echo 'page01.pre:' 'original size' '3385,' 'current size' "$shar_count!"
+ test 3386 -eq "$shar_count" ||
+ $echo 'page01.pre:' 'original size' '3386,' 'current size' "$shar_count!"
fi
fi
# ============= page02.pre ==============
@@ -411,23 +411,27 @@ else
X
<P>Finally, <A HREF="thread_pool.cpp">thread_pool.cpp</A>
where we have the Thread_Pool object implementation.
-X
+<P>
+Remember back in <A HREF="../006/page01.html">Tutorial 6</A> when I
+X was talking about <i>THR_NEW_LWP</i>? Look closely and you'll
+X see it here. It's bitwise OR'd with <i>THR_DETACHED</i> just to
+X keep things interesting.
<P>
<HR WIDTH="100%">
SHAR_EOF
- $shar_touch -am 0121152699 'page08.pre' &&
+ $shar_touch -am 0921222899 'page08.pre' &&
chmod 0664 'page08.pre' ||
$echo 'restore of' 'page08.pre' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page08.pre:' 'MD5 check failed'
-f8912fa7d6f1140a741479243bf5e924 page08.pre
+57908face42dc1aeef042433e6877213 page08.pre
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page08.pre'`"
- test 135 -eq "$shar_count" ||
- $echo 'page08.pre:' 'original size' '135,' 'current size' "$shar_count!"
+ test 378 -eq "$shar_count" ||
+ $echo 'page08.pre:' 'original size' '378,' 'current size' "$shar_count!"
fi
fi
# ============= page09.pre ==============
@@ -677,5 +681,5 @@ SHAR_EOF
$echo 'page07.pst:' 'original size' '97,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh24460
+rm -fr _sh04829
exit 0
diff --git a/docs/tutorials/007/page01.html b/docs/tutorials/007/page01.html
index a1cd7ceac79..99d0a81a25e 100644
--- a/docs/tutorials/007/page01.html
+++ b/docs/tutorials/007/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -64,7 +65,7 @@ threads in the pool. Also, the ACE_Guard class has been used to provide
thread-safe counter-incrementation and destruction of the Message_Blocks
of the thread-pool. This class guards the critical section region by
acquiring the mutex lock on creation and releasing it as soon as it goes
-out of scope.
+out of scope.
<P>
Note: a sleep period before all the threads in the pool exit is
necessary for complete destruction of the thread pool.
@@ -74,8 +75,8 @@ thread-pool strategy and how it can be managed using the ACE_Task class,
which provides an OO approach to thread-creation and implementation.
</UL>
<font size=-1>* The additions to this tutorial make use of
-ACE_Message_Queue which is discussed in depth in
-<A HREF="../010/page01.html">Tutorial 10</A>. Feel free to read ahead
+ACE_Message_Queue which is discussed in depth in
+<A HREF="../010/page01.html">Tutorial 10</A>. Feel free to read ahead
if you get lost in the message queue stuff.
</font>
<P><HR WIDTH="100%">
diff --git a/docs/tutorials/007/page02.html b/docs/tutorials/007/page02.html
index cea8488437e..25aa0f050d6 100644
--- a/docs/tutorials/007/page02.html
+++ b/docs/tutorials/007/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -51,7 +52,7 @@ static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
though we're not going to use the parameters, we still have to
specify them. */</font>
-int
+int
main (int argc, char *argv[])
{
<font color=red>/* In our earlier servers, we used a global pointer to get to the
@@ -93,7 +94,7 @@ main (int argc, char *argv[])
<font color=red>/* Like ACE_ERROR_RETURN, the ACE_DEBUG macro gets used quite a bit.
It's a handy way to generate uniform debug output from your
program. */</font>
- ACE_DEBUG ((LM_DEBUG,
+ ACE_DEBUG ((LM_DEBUG,
"<font color=green>(%P|%t) starting up server daemon\n</font>"));
<font color=red>/* This will loop "<font color=green>forever</font>" invoking the handle_events() method of
@@ -111,7 +112,7 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG,
"<font color=green>(%P|%t) shutting down server daemon\n</font>"));
-
+
return 0;
}
diff --git a/docs/tutorials/007/page03.html b/docs/tutorials/007/page03.html
index fd94b553c56..8f7a6e9bb98 100644
--- a/docs/tutorials/007/page03.html
+++ b/docs/tutorials/007/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -112,7 +113,7 @@ public:
<font color=red>/* What is our concurrency strategy? */</font>
int concurrency (void)
- {
+ {
return this->concurrency_;
}
@@ -122,7 +123,7 @@ public:
globally accessible thread pool. ACE_Singleton&lt;> is a way to
achieve that. */</font>
Thread_Pool *thread_pool (void)
- {
+ {
return &this->the_thread_pool_;
}
@@ -130,8 +131,8 @@ public:
are times when we need to know if the thread pool we're using is
ours or if we're just borrowing it from somebody else. */</font>
int thread_pool_is_private (void)
- {
- return &the_thread_pool_ == &private_thread_pool_;
+ {
+ return &the_thread_pool_ == &private_thread_pool_;
}
protected:
diff --git a/docs/tutorials/007/page04.html b/docs/tutorials/007/page04.html
index dbd16330e07..2415d48ff56 100644
--- a/docs/tutorials/007/page04.html
+++ b/docs/tutorials/007/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -53,7 +54,7 @@ I finally had enough code to move it out of the header.
Notice how we delegate most of the open() work to the open() method
of our baseclass. */</font>
-int
+int
<font color=#008888>Client_Acceptor::open</font> (const ACE_INET_Addr &addr,
ACE_Reactor *reactor,
int pool_size)
@@ -66,7 +67,7 @@ int
<font color=red>/* Here again we find that we have to manage the thread pool. Like
open() we also delegate the other work to our baseclass. */</font>
-int
+int
<font color=#008888>Client_Acceptor::close</font> (void)
{
if (this->concurrency() == thread_pool_ && thread_pool_is_private ())
diff --git a/docs/tutorials/007/page05.html b/docs/tutorials/007/page05.html
index 9c2264e6e7d..d0995ca37a5 100644
--- a/docs/tutorials/007/page05.html
+++ b/docs/tutorials/007/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -140,16 +141,16 @@ protected:
for information. It is generally a good idea to do that through
an accesor rather than using the member variable directly. */</font>
Client_Acceptor *client_acceptor (void)
- {
- return this->client_acceptor_;
+ {
+ return this->client_acceptor_;
}
<font color=red>/* And since you shouldn't access a member variable directly,
neither should you set (mutate) it. Although it might seem silly
to do it this way, you'll thank yourself for it later. */</font>
void client_acceptor (Client_Acceptor *_client_acceptor)
- {
- this->client_acceptor_ = _client_acceptor;
+ {
+ this->client_acceptor_ = _client_acceptor;
}
<font color=red>/* The concurrency() accessor tells us the current concurrency
diff --git a/docs/tutorials/007/page06.html b/docs/tutorials/007/page06.html
index 7ca248b2961..61f9a4d836e 100644
--- a/docs/tutorials/007/page06.html
+++ b/docs/tutorials/007/page06.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -53,14 +54,14 @@ though.
<font color=red>/* Query our acceptor for the concurrency strategy. Notice that we
don't bother to check that our acceptor pointer is valid. That is
proably a bad idea... */</font>
-int
+int
<font color=#008888>Client_Handler::concurrency</font>(void)
{
return this->client_acceptor ()->concurrency ();
}
<font color=red>/* And here we ask the acceptor about the thread pool. */</font>
-Thread_Pool *
+Thread_Pool *
<font color=#008888>Client_Handler::thread_pool</font> (void)
{
return this->client_acceptor ()->thread_pool ();
@@ -68,13 +69,13 @@ Thread_Pool *
<font color=red>/* Back to our open() method. This is straight out of Tutorial 6.
There's nothing additional here for the thread-pool implementation. */</font>
-int
+int
<font color=#008888>Client_Handler::open</font> (void *acceptor)
{
client_acceptor ((Client_Acceptor *) acceptor);
if (concurrency () == <font color=#008888>Client_Acceptor::thread_per_connection_</font>)
- return this->activate ();
+ return this->activate (THR_DETACHED);
this->reactor (client_acceptor()->reactor ());
@@ -98,7 +99,7 @@ int
<font color=red>/* The destroy() method will remove us from the reactor (with the
DONT_CALL flag set!) and then free our memory. This allows us to
be closed from outside of the reactor context without any danger. */</font>
-void
+void
<font color=#008888>Client_Handler::destroy</font> (void)
{
this->reactor ()->remove_handler (this, REMOVE_MASK);
@@ -107,7 +108,7 @@ void
<font color=red>/* As mentioned in the header, the typical way to close an object in a
threaded context is to invoke it's close() method. */</font>
-int
+int
<font color=#008888>Client_Handler::close</font> (u_long flags)
{
<font color=red>/*
@@ -116,7 +117,7 @@ int
freeing our memory.
*/</font>
this->destroy ();
-
+
<font color=red>/* Don't forward the close() to the baseclass! handle_close() above
has already taken care of delete'ing. Forwarding close() would
cause that to happen again and things would get really ugly at
@@ -126,7 +127,7 @@ int
<font color=red>/* We will be called when handle_input() returns -1. That's our queue
to delete ourselves to prevent memory leaks. */</font>
-int
+int
<font color=#008888>Client_Handler::handle_close</font> (ACE_HANDLE handle,
ACE_Reactor_Mask mask)
{
@@ -134,7 +135,7 @@ int
ACE_UNUSED_ARG (mask);
delete this;
-
+
return 0;
}
@@ -151,7 +152,7 @@ int
that case, we arrange to be put into the thread pool. If we're not
in the creator thread then we must be in the thread pool and we can
do some work. */</font>
-int
+int
<font color=#008888>Client_Handler::handle_input</font> (ACE_HANDLE handle)
{
ACE_UNUSED_ARG (handle);
@@ -209,7 +210,7 @@ int
<font color=red>/* Remember that when we leave our svc() method, the framework will
take care of calling our close() method so that we can cleanup
after ourselves. */</font>
-int
+int
<font color=#008888>Client_Handler::svc</font> (void)
{
char buf[BUFSIZ];
@@ -225,7 +226,7 @@ int
all affected by our choice of threading models. Of course, I'm not
sharing data between threads or anything. We'll leave locking
issues for a later tutorial. */</font>
-int
+int
<font color=#008888>Client_Handler::process</font> (char *rdbuf,
int rdbuf_len)
{
diff --git a/docs/tutorials/007/page07.html b/docs/tutorials/007/page07.html
index 7b31b7d09e7..462dac9189a 100644
--- a/docs/tutorials/007/page07.html
+++ b/docs/tutorials/007/page07.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -72,7 +73,7 @@ public:
baseclass method. */</font>
virtual int open (void *void_data)
{
- return <font color=#008888>inherited::open</font> (void_data);
+ return <font color=#008888>inherited::open</font> (void_data);
}
<font color=red>/*
diff --git a/docs/tutorials/007/page08.html b/docs/tutorials/007/page08.html
index f3b7a1d1b6e..d25a7e3e61d 100644
--- a/docs/tutorials/007/page08.html
+++ b/docs/tutorials/007/page08.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -15,7 +16,11 @@
<P>Finally, <A HREF="thread_pool.cpp">thread_pool.cpp</A>
where we have the Thread_Pool object implementation.
-
+<P>
+Remember back in <A HREF="../006/page01.html">Tutorial 6</A> when I
+ was talking about <i>THR_NEW_LWP</i>? Look closely and you'll
+ see it here. It's bitwise OR'd with <i>THR_DETACHED</i> just to
+ keep things interesting.
<P>
<HR WIDTH="100%">
<PRE>
@@ -37,16 +42,16 @@ where we have the Thread_Pool object implementation.
activate() method. By hiding activate() in this way, the users of
Thread_Pool don't have to worry about the thread configuration
flags. */</font>
-int
+int
<font color=#008888>Thread_Pool::open</font> (int pool_size)
{
- return this->activate (THR_NEW_LWP, pool_size);
+ return this->activate (THR_NEW_LWP|THR_DETACHED, pool_size);
}
<font color=red>/* Closing the thread pool can be a tricky exercise. I've decided to
take an easy approach and simply enqueue a secret message for each
thread we have active. */</font>
-int
+int
<font color=#008888>Thread_Pool::close</font> (u_long flags)
{
ACE_UNUSED_ARG(flags);
@@ -73,7 +78,7 @@ int
<font color=red>/* When an object wants to do work in the pool, it should call the
enqueue() method. We introduce the ACE_Message_Block here but,
unfortunately, we seriously misuse it. */</font>
-int
+int
<font color=#008888>Thread_Pool::enqueue</font> (ACE_Event_Handler *handler)
{
<font color=red>/* An ACE_Message_Block is a chunk of data. You put them into an
@@ -186,7 +191,7 @@ protected:
<font color=red>/* Now we come to the svc() method. As I said, this is being executed
in each thread of the Thread_Pool. Here, we pull messages off of
our built-in ACE_Message_Queue and cause them to do work. */</font>
-int
+int
<font color=#008888>Thread_Pool::svc</font> (void)
{
<font color=red>/* The getq() method takes a reference to a pointer. So... we need
@@ -235,9 +240,9 @@ int
work. If you're careful you can get away with casting
pointers around.) */</font>
void *v_data = (void *) c_data;
-
+
ACE_Event_Handler *handler = (ACE_Event_Handler *) v_data;
-
+
<font color=red>/* Now that we finally have an event handler pointer, invoke
it's handle_input() method. Since we don't know it's
handle, we just give it a default. That's OK because we
diff --git a/docs/tutorials/007/page09.html b/docs/tutorials/007/page09.html
index 498f6c19ffd..3331cd46a4f 100644
--- a/docs/tutorials/007/page09.html
+++ b/docs/tutorials/007/page09.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -54,7 +55,7 @@ to include it here.
<HR WIDTH="100%">
<P>
<center><h2>Danger, Warning!</h2></center>
-Now that I've gone through all of this to create a thread pool server,
+Now that I've gone through all of this to create a thread pool server,
I have to point out that this isn't exactly the best or safest way to
do so. The biggest danger we face with this approach is the
possibility of an event handler existing in the thread pool's message
diff --git a/docs/tutorials/007/server.cpp b/docs/tutorials/007/server.cpp
index d7e616dfdaf..878a5035460 100644
--- a/docs/tutorials/007/server.cpp
+++ b/docs/tutorials/007/server.cpp
@@ -33,7 +33,7 @@ static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
though we're not going to use the parameters, we still have to
specify them. */
-int
+int
main (int argc, char *argv[])
{
/* In our earlier servers, we used a global pointer to get to the
@@ -75,7 +75,7 @@ main (int argc, char *argv[])
/* Like ACE_ERROR_RETURN, the ACE_DEBUG macro gets used quite a bit.
It's a handy way to generate uniform debug output from your
program. */
- ACE_DEBUG ((LM_DEBUG,
+ ACE_DEBUG ((LM_DEBUG,
"(%P|%t) starting up server daemon\n"));
/* This will loop "forever" invoking the handle_events() method of
@@ -93,7 +93,7 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) shutting down server daemon\n"));
-
+
return 0;
}
diff --git a/docs/tutorials/007/thread_pool.cpp b/docs/tutorials/007/thread_pool.cpp
index 8042b76b7e5..08302a6811f 100644
--- a/docs/tutorials/007/thread_pool.cpp
+++ b/docs/tutorials/007/thread_pool.cpp
@@ -16,16 +16,16 @@ Thread_Pool::Thread_Pool (void)
activate() method. By hiding activate() in this way, the users of
Thread_Pool don't have to worry about the thread configuration
flags. */
-int
+int
Thread_Pool::open (int pool_size)
{
- return this->activate (THR_NEW_LWP, pool_size);
+ return this->activate (THR_NEW_LWP|THR_DETACHED, pool_size);
}
/* Closing the thread pool can be a tricky exercise. I've decided to
take an easy approach and simply enqueue a secret message for each
thread we have active. */
-int
+int
Thread_Pool::close (u_long flags)
{
ACE_UNUSED_ARG(flags);
@@ -52,7 +52,7 @@ Thread_Pool::close (u_long flags)
/* When an object wants to do work in the pool, it should call the
enqueue() method. We introduce the ACE_Message_Block here but,
unfortunately, we seriously misuse it. */
-int
+int
Thread_Pool::enqueue (ACE_Event_Handler *handler)
{
/* An ACE_Message_Block is a chunk of data. You put them into an
@@ -165,7 +165,7 @@ protected:
/* Now we come to the svc() method. As I said, this is being executed
in each thread of the Thread_Pool. Here, we pull messages off of
our built-in ACE_Message_Queue and cause them to do work. */
-int
+int
Thread_Pool::svc (void)
{
/* The getq() method takes a reference to a pointer. So... we need
@@ -214,9 +214,9 @@ Thread_Pool::svc (void)
work. If you're careful you can get away with casting
pointers around.) */
void *v_data = (void *) c_data;
-
+
ACE_Event_Handler *handler = (ACE_Event_Handler *) v_data;
-
+
/* Now that we finally have an event handler pointer, invoke
it's handle_input() method. Since we don't know it's
handle, we just give it a default. That's OK because we
diff --git a/docs/tutorials/007/thread_pool.h b/docs/tutorials/007/thread_pool.h
index 32f44e4c0af..9686b5a29da 100644
--- a/docs/tutorials/007/thread_pool.h
+++ b/docs/tutorials/007/thread_pool.h
@@ -49,7 +49,7 @@ public:
baseclass method. */
virtual int open (void *void_data)
{
- return inherited::open (void_data);
+ return inherited::open (void_data);
}
/*
diff --git a/docs/tutorials/008/broadcast_client.cpp b/docs/tutorials/008/broadcast_client.cpp
index 126b125ffc4..c514ca000ef 100644
--- a/docs/tutorials/008/broadcast_client.cpp
+++ b/docs/tutorials/008/broadcast_client.cpp
@@ -5,7 +5,7 @@
static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
-int
+int
main (int argc,char *argv[])
{
ACE_INET_Addr local ((u_short) 0);
@@ -44,7 +44,7 @@ main (int argc,char *argv[])
ACE_INET_Addr remote (PORT,
INADDR_BROADCAST);
- ACE_DEBUG ((LM_DEBUG,
+ ACE_DEBUG ((LM_DEBUG,
"(%P|%t) Sending (%s) to the server.\n",
buf));
diff --git a/docs/tutorials/008/combine.shar b/docs/tutorials/008/combine.shar
index f12ae4c4ee3..3ff0c16dcb6 100644
--- a/docs/tutorials/008/combine.shar
+++ b/docs/tutorials/008/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-01-26 19:48 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/008'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/008'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -67,7 +67,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh30434; then
+if mkdir _sh04873; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -461,5 +461,5 @@ SHAR_EOF
$echo 'page04.pst:' 'original size' '1173,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh30434
+rm -fr _sh04873
exit 0
diff --git a/docs/tutorials/008/directed_client.cpp b/docs/tutorials/008/directed_client.cpp
index d11367aa43e..587a671fe09 100644
--- a/docs/tutorials/008/directed_client.cpp
+++ b/docs/tutorials/008/directed_client.cpp
@@ -14,7 +14,7 @@ static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
/* Our goal here is to develop a client that can send a datagram to a
server running on a known host. We'll use a command-line argument
to specify the hostname instead of hard-coding it. */
-int
+int
main (int argc,char *argv[])
{
/* All datagrams must have a point of origin. Since we intend to
@@ -30,7 +30,7 @@ main (int argc,char *argv[])
/* And here is our datagram object. */
ACE_SOCK_Dgram dgram;
-
+
/* Notice that this looks a lot like the server application.
There's no difference in creating server datagrams an client
datagrams. You can even use a zero-constructed address for your
@@ -102,6 +102,6 @@ main (int argc,char *argv[])
"(%P|%t) The server can be found at: (%s:%d)\n",
remote.get_host_name(),
PORT));
-
+
return 0;
}
diff --git a/docs/tutorials/008/page01.html b/docs/tutorials/008/page01.html
index ce6f508f67a..b36512032a1 100644
--- a/docs/tutorials/008/page01.html
+++ b/docs/tutorials/008/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -61,7 +62,7 @@ no solid connection is made. On the recv() itself the server obtains the
address of the remote client and then communicates with it.
<P>
Thus, we get a fair glimpse of using another means of communication via
-datagrams.
+datagrams.
</UL>
<P><FONT SIZE=-1>*&nbsp;Actually, the servers <I>might</I> hear the datagram.&nbsp;
Datagrams are rather unreliable.&nbsp; (Sort of like some operating systems
diff --git a/docs/tutorials/008/page02.html b/docs/tutorials/008/page02.html
index c501c12bad9..9d65274f846 100644
--- a/docs/tutorials/008/page02.html
+++ b/docs/tutorials/008/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -35,7 +36,7 @@ it responds to.&nbsp; We'll tackle that issue in the next tutorial though...
<font color=red>/* Use the typical TCP/IP port address for receiving datagrams. */</font>
static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
-int
+int
main (int, char**)
{
<font color=red>/* This is where we'll listen for datagrams coming from the clients.
diff --git a/docs/tutorials/008/page03.html b/docs/tutorials/008/page03.html
index 36c58e4d3c5..e7454181b46 100644
--- a/docs/tutorials/008/page03.html
+++ b/docs/tutorials/008/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -41,7 +42,7 @@ static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
<font color=red>/* Our goal here is to develop a client that can send a datagram to a
server running on a known host. We'll use a command-line argument
to specify the hostname instead of hard-coding it. */</font>
-int
+int
main (int argc,char *argv[])
{
<font color=red>/* All datagrams must have a point of origin. Since we intend to
@@ -57,7 +58,7 @@ main (int argc,char *argv[])
<font color=red>/* And here is our datagram object. */</font>
ACE_SOCK_Dgram dgram;
-
+
<font color=red>/* Notice that this looks a lot like the server application.
There's no difference in creating server datagrams an client
datagrams. You can even use a zero-constructed address for your
@@ -129,7 +130,7 @@ main (int argc,char *argv[])
"<font color=green>(%P|%t) The server can be found at: (%s:%d)\n</font>",
remote.get_host_name(),
PORT));
-
+
return 0;
}
</PRE>
diff --git a/docs/tutorials/008/page04.html b/docs/tutorials/008/page04.html
index faaaed77dce..c57459e7665 100644
--- a/docs/tutorials/008/page04.html
+++ b/docs/tutorials/008/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -32,7 +33,7 @@ subnet you're a part of.
static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
-int
+int
main (int argc,char *argv[])
{
ACE_INET_Addr local ((u_short) 0);
@@ -71,7 +72,7 @@ main (int argc,char *argv[])
ACE_INET_Addr remote (PORT,
INADDR_BROADCAST);
- ACE_DEBUG ((LM_DEBUG,
+ ACE_DEBUG ((LM_DEBUG,
"<font color=green>(%P|%t) Sending (%s) to the server.\n</font>",
buf));
diff --git a/docs/tutorials/008/page05.html b/docs/tutorials/008/page05.html
index bb1b157098e..4e40cfa3274 100644
--- a/docs/tutorials/008/page05.html
+++ b/docs/tutorials/008/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/008/server.cpp b/docs/tutorials/008/server.cpp
index 629c2dd42c8..dd54d61db59 100644
--- a/docs/tutorials/008/server.cpp
+++ b/docs/tutorials/008/server.cpp
@@ -8,7 +8,7 @@
/* Use the typical TCP/IP port address for receiving datagrams. */
static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
-int
+int
main (int, char**)
{
/* This is where we'll listen for datagrams coming from the clients.
diff --git a/docs/tutorials/009/broadcast_client.cpp b/docs/tutorials/009/broadcast_client.cpp
index 866e90c2588..f14b7db2c9c 100644
--- a/docs/tutorials/009/broadcast_client.cpp
+++ b/docs/tutorials/009/broadcast_client.cpp
@@ -5,7 +5,7 @@
static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
-int
+int
main (int argc, char *argv[])
{
ACE_INET_Addr local ((u_short) 0);
diff --git a/docs/tutorials/009/combine.shar b/docs/tutorials/009/combine.shar
index c12d2186061..1115db82066 100644
--- a/docs/tutorials/009/combine.shar
+++ b/docs/tutorials/009/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-01-21 20:41 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/009'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/009'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -15,7 +15,7 @@
# 59 -rw-rw-r-- bodies
# 2185 -rw-rw-r-- page01.pre
# 188 -rw-rw-r-- page02.pre
-# 295 -rw-rw-r-- page03.pre
+# 296 -rw-rw-r-- page03.pre
# 301 -rw-rw-r-- page04.pre
# 995 -rw-rw-r-- page05.pre
# 81 -rw-rw-r-- page02.pst
@@ -66,7 +66,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh23750; then
+if mkdir _sh04903; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -250,12 +250,12 @@ SHAR_EOF
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page03.pre:' 'MD5 check failed'
-58878c3f2b7d458371fdf243db6cba61 page03.pre
+c89d6d6f4acee2953a95469a3fe6965f page03.pre
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page03.pre'`"
- test 295 -eq "$shar_count" ||
- $echo 'page03.pre:' 'original size' '295,' 'current size' "$shar_count!"
+ test 296 -eq "$shar_count" ||
+ $echo 'page03.pre:' 'original size' '296,' 'current size' "$shar_count!"
fi
fi
# ============= page04.pre ==============
@@ -390,5 +390,5 @@ SHAR_EOF
$echo 'page03.pst:' 'original size' '96,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh23750
+rm -fr _sh04903
exit 0
diff --git a/docs/tutorials/009/directed_client.cpp b/docs/tutorials/009/directed_client.cpp
index 31ff8481ea7..1d6af7f206b 100644
--- a/docs/tutorials/009/directed_client.cpp
+++ b/docs/tutorials/009/directed_client.cpp
@@ -5,7 +5,7 @@
static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
-int
+int
main (int argc, char *argv[])
{
ACE_INET_Addr local ((u_short) 0);
diff --git a/docs/tutorials/009/page01.html b/docs/tutorials/009/page01.html
index cadc7cb5484..9483531d89d 100644
--- a/docs/tutorials/009/page01.html
+++ b/docs/tutorials/009/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -47,7 +48,7 @@ decides on replying to the client depending on the signature. The only
changes from the previous tutorial are in the addition of an extra
signature matching portion on the server side and providing timeout
values on the client side which allows the send() and recv() calls to
-return on a timeout if the target party fails to respond.
+return on a timeout if the target party fails to respond.
<P>
This feature of discrimnation depending on the client signature could be
used for security reasons or version confirmation by the server.
diff --git a/docs/tutorials/009/page02.html b/docs/tutorials/009/page02.html
index 7dd126f1273..984297ca849 100644
--- a/docs/tutorials/009/page02.html
+++ b/docs/tutorials/009/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -37,7 +38,7 @@ static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
"<font color=green>signature</font>". If none is given, we'll use the one here instead. */</font>
static const char *default_signature = "<font color=green>Hello World!</font>";
-int
+int
main (int argc, char *argv[])
{
ACE_INET_Addr local (PORT);
diff --git a/docs/tutorials/009/page03.html b/docs/tutorials/009/page03.html
index 61591c5c711..2a6f3c0680e 100644
--- a/docs/tutorials/009/page03.html
+++ b/docs/tutorials/009/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -30,7 +31,7 @@ if the server doesn't like what we have to say.
static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
-int
+int
main (int argc, char *argv[])
{
ACE_INET_Addr local ((u_short) 0);
diff --git a/docs/tutorials/009/page04.html b/docs/tutorials/009/page04.html
index 0faedf88168..dea8c49aa29 100644
--- a/docs/tutorials/009/page04.html
+++ b/docs/tutorials/009/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -30,7 +31,7 @@ of the timeout variable passed to recv().
static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
-int
+int
main (int argc, char *argv[])
{
ACE_INET_Addr local ((u_short) 0);
diff --git a/docs/tutorials/009/page05.html b/docs/tutorials/009/page05.html
index e1524d202ff..697cde8fdaa 100644
--- a/docs/tutorials/009/page05.html
+++ b/docs/tutorials/009/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/009/server.cpp b/docs/tutorials/009/server.cpp
index fe994ae27fa..c77bc987e60 100644
--- a/docs/tutorials/009/server.cpp
+++ b/docs/tutorials/009/server.cpp
@@ -14,7 +14,7 @@ static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
"signature". If none is given, we'll use the one here instead. */
static const char *default_signature = "Hello World!";
-int
+int
main (int argc, char *argv[])
{
ACE_INET_Addr local (PORT);
diff --git a/docs/tutorials/010/combine.shar b/docs/tutorials/010/combine.shar
index ce6e2a2ef31..7ea380a082a 100644
--- a/docs/tutorials/010/combine.shar
+++ b/docs/tutorials/010/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-02-09 16:27 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/010'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/010'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -23,7 +23,7 @@
# 689 -rw-rw-r-- page02.pst
# 237 -rw-rw-r-- page03.pst
# 387 -rw-rw-r-- page04.pst
-# 366 -rw-rw-r-- page05.pst
+# 647 -rw-rw-r-- page05.pst
#
save_IFS="${IFS}"
IFS="${IFS}:"
@@ -70,7 +70,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh15890; then
+if mkdir _sh04931; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -525,21 +525,26 @@ This is all pretty straight-forward too. One gottcha we avoided was a memory le
due to our shutdown message. Notice that svc() enqueues that block without bothering
to see if there are any more threads to dequeue it. Thats why our dtor can call getq()
without worrying about blocking infinitely: it knows the message block will be there.
+<P>
+Also notice that we haven't used <i>THR_DETACHED</i> in this
+X tutorial. Why? Because in <i>message_queue.cpp</i> we call
+X <i>wait()</i> to wait for all of the task's threads to exit.
+X That prevents the leak that we normally avoid by using <i>THR_DETACHED</i>.
SHAR_EOF
- $shar_touch -am 0124153399 'page05.pst' &&
+ $shar_touch -am 0921223299 'page05.pst' &&
chmod 0664 'page05.pst' ||
$echo 'restore of' 'page05.pst' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page05.pst:' 'MD5 check failed'
-54b2e8e21aa451c7a3a227da8069bdf7 page05.pst
+802d999314ebcf28ebbffe6fb6dedcfa page05.pst
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page05.pst'`"
- test 366 -eq "$shar_count" ||
- $echo 'page05.pst:' 'original size' '366,' 'current size' "$shar_count!"
+ test 647 -eq "$shar_count" ||
+ $echo 'page05.pst:' 'original size' '647,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh15890
+rm -fr _sh04931
exit 0
diff --git a/docs/tutorials/010/message_queue.cpp b/docs/tutorials/010/message_queue.cpp
index a0be6d5afa9..a67f72d01e2 100644
--- a/docs/tutorials/010/message_queue.cpp
+++ b/docs/tutorials/010/message_queue.cpp
@@ -6,7 +6,7 @@
#include "task.h"
#include "block.h"
-int
+int
run_test (int iterations,
int threads)
{
@@ -67,22 +67,22 @@ run_test (int iterations,
/* Wait for the threads in our task object to go away. */
task.wait ();
-
+
return 0;
}
-int
+int
main (int argc, char *argv[])
{
/* Set the number of iterations through our putq() loop and the
number of threads to use in our Task<> derivative. */
int iterations = argc > 1 ? atoi (argv[1]) : 9;
int threads = argc > 2 ? atoi (argv[2]) : 2;
-
+
run_test (iterations, threads);
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) Application exiting\n"));
-
+
return 0;
}
diff --git a/docs/tutorials/010/page01.html b/docs/tutorials/010/page01.html
index 8e27323bd1a..6029dd398eb 100644
--- a/docs/tutorials/010/page01.html
+++ b/docs/tutorials/010/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -34,8 +35,8 @@ The Message Queue is a FIFO accessible from multiple threads.
That is, a thread puts the produced blocks of data on the message queue
to be consumed by some other thread/threads and processed. In this
tutorial, we see how effectively the Message Queue in a ACE_Task can be
-used to pass data among threads in the thread pool.
-(this is very similar to
+used to pass data among threads in the thread pool.
+(this is very similar to
<A HREF="../007/page01.html">Tutorial 7</A>
wherein we implemented a
thread-pool server).Here, actual data is passed between the threads and
@@ -45,10 +46,10 @@ multiple threads.
The Message Queue consists of Message Blocks, each of which has a read
and write pointer. Using these pointers the message blocks can be
accessed for reading and writing operations. The ACE_Task::svc() method
-will put the block onto the queue without bothering about the existence
+will put the block onto the queue without bothering about the existence
of a consumer for that block. A thread from the thread pool obtains the
block from the queue, and checks to see whether the block_type is
-MB_HANGUP. If so, it puts the block back on the queue for its
+MB_HANGUP. If so, it puts the block back on the queue for its
peers and exits. Otherwise, it reads the block and processes it before
releasing it.
<P>
diff --git a/docs/tutorials/010/page02.html b/docs/tutorials/010/page02.html
index 49beffefbd9..70dcb87a491 100644
--- a/docs/tutorials/010/page02.html
+++ b/docs/tutorials/010/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -27,7 +28,7 @@ We'll look first at <A HREF="message_queue.cpp">main()</A>.
<font color=blue>#include</font> "<font color=green>task.h</font>"
<font color=blue>#include</font> "<font color=green>block.h</font>"
-int
+int
run_test (int iterations,
int threads)
{
@@ -88,23 +89,23 @@ run_test (int iterations,
<font color=red>/* Wait for the threads in our task object to go away. */</font>
task.wait ();
-
+
return 0;
}
-int
+int
main (int argc, char *argv[])
{
<font color=red>/* Set the number of iterations through our putq() loop and the
number of threads to use in our Task&lt;> derivative. */</font>
int iterations = argc > 1 ? atoi (argv[1]) : 9;
int threads = argc > 2 ? atoi (argv[2]) : 2;
-
+
run_test (iterations, threads);
ACE_DEBUG ((LM_DEBUG,
"<font color=green>(%P|%t) Application exiting\n</font>"));
-
+
return 0;
}
</PRE>
diff --git a/docs/tutorials/010/page03.html b/docs/tutorials/010/page03.html
index 84d9b3bb6f0..c54453da6b1 100644
--- a/docs/tutorials/010/page03.html
+++ b/docs/tutorials/010/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -68,6 +69,6 @@ public:
Ok, nothing really magic there. Some folks just feel a little uncomfortable
not doing an explicit <i>delete</i> on objects they've <i>new</i>'d so I
wanted to show you that the memory really does get cleaned up.
-
+
<P><HR WIDTH="100%">
<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page04.html">Continue This Tutorial</A>]</CENTER>
diff --git a/docs/tutorials/010/page04.html b/docs/tutorials/010/page04.html
index a36a8d8bd29..f23fd740c32 100644
--- a/docs/tutorials/010/page04.html
+++ b/docs/tutorials/010/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/010/page05.html b/docs/tutorials/010/page05.html
index dca2a02b74e..35e04172a2c 100644
--- a/docs/tutorials/010/page05.html
+++ b/docs/tutorials/010/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -25,7 +26,7 @@ is invoked, the semaphore is decremented and the thread is blocked.
When the count equals zero, all threads are unblocked and allowed to
continue.
<P>
-<font size=-1>Note: This isn't the way ACE_Barrier really works, it's
+<font size=-1>Note: This isn't the way ACE_Barrier really works, it's
just an analogy</font>
<HR WIDTH="100%">
@@ -64,7 +65,7 @@ just an analogy</font>
<font color=red>/* Open the object to do work. Next, we activate the Task into the
number of requested threads. */</font>
-int
+int
<font color=#008888>Task::open</font> (void *unused)
{
ACE_UNUSED_ARG (unused);
@@ -75,7 +76,7 @@ int
<font color=red>/* Tell the user we're closing and invoke the baseclass' close() to
take care of things. */</font>
-int
+int
<font color=#008888>Task::close</font> (u_long flags)
{
ACE_DEBUG ((LM_DEBUG,
@@ -86,7 +87,7 @@ int
<font color=red>/* Our svc() method waits for work on the queue and then processes
that work. */</font>
-int
+int
<font color=#008888>Task::svc</font> (void)
{
<font color=red>/* This will cause all of the threads to wait on this line until all
@@ -134,7 +135,7 @@ int
useful here since we won't be reading any more from the block
but it's a good habit to get into. */</font>
message->rd_ptr (<font color=#008888>ACE_OS::strlen</font> (cp));
-
+
<font color=red>/* Display the block's address and data to the user. */</font>
ACE_DEBUG ((LM_DEBUG,
"<font color=green>(%P|%t) Block 0x%x contains (%s)\n</font>",
@@ -160,5 +161,10 @@ This is all pretty straight-forward too. One gottcha we avoided was a memory le
due to our shutdown message. Notice that svc() enqueues that block without bothering
to see if there are any more threads to dequeue it. Thats why our dtor can call getq()
without worrying about blocking infinitely: it knows the message block will be there.
+<P>
+Also notice that we haven't used <i>THR_DETACHED</i> in this
+ tutorial. Why? Because in <i>message_queue.cpp</i> we call
+ <i>wait()</i> to wait for all of the task's threads to exit.
+ That prevents the leak that we normally avoid by using <i>THR_DETACHED</i>.
<P><HR WIDTH="100%">
<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page06.html">Continue This Tutorial</A>]</CENTER>
diff --git a/docs/tutorials/010/page06.html b/docs/tutorials/010/page06.html
index 9e50e08c41f..f6d67c3b969 100644
--- a/docs/tutorials/010/page06.html
+++ b/docs/tutorials/010/page06.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/010/page07.html b/docs/tutorials/010/page07.html
index 130fa539f60..6fdb180c494 100644
--- a/docs/tutorials/010/page07.html
+++ b/docs/tutorials/010/page07.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/010/task.cpp b/docs/tutorials/010/task.cpp
index 8fa62ee0e7c..238b1882727 100644
--- a/docs/tutorials/010/task.cpp
+++ b/docs/tutorials/010/task.cpp
@@ -32,7 +32,7 @@ Task::~Task (void)
/* Open the object to do work. Next, we activate the Task into the
number of requested threads. */
-int
+int
Task::open (void *unused)
{
ACE_UNUSED_ARG (unused);
@@ -43,7 +43,7 @@ Task::open (void *unused)
/* Tell the user we're closing and invoke the baseclass' close() to
take care of things. */
-int
+int
Task::close (u_long flags)
{
ACE_DEBUG ((LM_DEBUG,
@@ -54,7 +54,7 @@ Task::close (u_long flags)
/* Our svc() method waits for work on the queue and then processes
that work. */
-int
+int
Task::svc (void)
{
/* This will cause all of the threads to wait on this line until all
@@ -102,7 +102,7 @@ Task::svc (void)
useful here since we won't be reading any more from the block
but it's a good habit to get into. */
message->rd_ptr (ACE_OS::strlen (cp));
-
+
/* Display the block's address and data to the user. */
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) Block 0x%x contains (%s)\n",
diff --git a/docs/tutorials/011/combine.shar b/docs/tutorials/011/combine.shar
index 1518d9c8a73..4796dd523f2 100644
--- a/docs/tutorials/011/combine.shar
+++ b/docs/tutorials/011/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-01-26 20:13 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/011'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/011'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -20,7 +20,7 @@
# 2691 -rw-rw-r-- page05.pre
# 707 -rw-rw-r-- page06.pre
# 351 -rw-rw-r-- page02.pst
-# 208 -rw-rw-r-- page03.pst
+# 366 -rw-rw-r-- page03.pst
# 129 -rw-rw-r-- page04.pst
#
save_IFS="${IFS}"
@@ -68,7 +68,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh31079; then
+if mkdir _sh04967; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -439,20 +439,23 @@ Notice how we had to create a temporary Data object to copy the stuff out
of the message block? Again, if there were non-trivial ctor/dtors involved
then this wouldn't work at all.
<P>
+Again, like <A HREF="../010/page01.html">Tutorial 10</A> we've skipped
+<i>THR_DETACHED</i> because we <i>wait()</i> for the threads to exit
+X elsewhere.
SHAR_EOF
- $shar_touch -am 0124154699 'page03.pst' &&
+ $shar_touch -am 0921223499 'page03.pst' &&
chmod 0664 'page03.pst' ||
$echo 'restore of' 'page03.pst' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page03.pst:' 'MD5 check failed'
-82c846e0d43ceb12c5d47686d7f69715 page03.pst
+ae1320ae6609c684317a5895f69bf47d page03.pst
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page03.pst'`"
- test 208 -eq "$shar_count" ||
- $echo 'page03.pst:' 'original size' '208,' 'current size' "$shar_count!"
+ test 366 -eq "$shar_count" ||
+ $echo 'page03.pst:' 'original size' '366,' 'current size' "$shar_count!"
fi
fi
# ============= page04.pst ==============
@@ -482,5 +485,5 @@ SHAR_EOF
$echo 'page04.pst:' 'original size' '129,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh31079
+rm -fr _sh04967
exit 0
diff --git a/docs/tutorials/011/message_queue.cpp b/docs/tutorials/011/message_queue.cpp
index 2ce18948534..3c91f7cc66f 100644
--- a/docs/tutorials/011/message_queue.cpp
+++ b/docs/tutorials/011/message_queue.cpp
@@ -7,7 +7,7 @@
#include "data.h"
-static int
+static int
run_test (int iterations,
int threads)
@@ -70,7 +70,7 @@ run_test (int iterations,
return 0;
}
-int
+int
main (int argc, char *argv[])
{
int iterations = argc > 1 ? atoi (argv[1]) : 4;
diff --git a/docs/tutorials/011/page01.html b/docs/tutorials/011/page01.html
index 8df08d2cd08..93a373ad767 100644
--- a/docs/tutorials/011/page01.html
+++ b/docs/tutorials/011/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/011/page02.html b/docs/tutorials/011/page02.html
index 1e31b4a4694..70da6d82bd4 100644
--- a/docs/tutorials/011/page02.html
+++ b/docs/tutorials/011/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -28,7 +29,7 @@ the same as before, so I've only commented the changes.
<font color=blue>#include</font> "<font color=green>data.h</font>"
-static int
+static int
run_test (int iterations,
int threads)
@@ -91,7 +92,7 @@ run_test (int iterations,
return 0;
}
-int
+int
main (int argc, char *argv[])
{
int iterations = argc > 1 ? atoi (argv[1]) : 4;
diff --git a/docs/tutorials/011/page03.html b/docs/tutorials/011/page03.html
index 78b9c5ebb53..c3e8be6df74 100644
--- a/docs/tutorials/011/page03.html
+++ b/docs/tutorials/011/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -50,7 +51,7 @@ public:
protected:
ACE_Barrier barrier_;
-
+
size_t n_threads_;
};
@@ -84,15 +85,15 @@ protected:
message->release ();
}
-int
+int
<font color=#008888>Task::open</font> (void *)
{
- return this->activate (THR_NEW_LWP,
+ return this->activate (THR_NEW_LWP,
this->n_threads_);
}
-int
+int
<font color=#008888>Task::close</font> (u_long flags)
{
ACE_DEBUG ((LM_DEBUG,
@@ -101,7 +102,7 @@ int
return <font color=#008888>inherited::close</font> (flags);
}
-int
+int
<font color=#008888>Task::svc</font> (void)
{
this->barrier_.wait ();
@@ -130,7 +131,7 @@ int
const char *cp = message->rd_ptr ();
<font color=red>// Don't forget to skip the NULL we inserted</font>
- message->rd_ptr (<font color=#008888>ACE_OS::strlen</font> (cp) + 1);
+ message->rd_ptr (<font color=#008888>ACE_OS::strlen</font> (cp) + 1);
ACE_DEBUG ((LM_DEBUG,
"<font color=green>(%P|%t) Block 0x%x contains (%s)\n</font>",
@@ -180,5 +181,8 @@ Notice how we had to create a temporary Data object to copy the stuff out
of the message block? Again, if there were non-trivial ctor/dtors involved
then this wouldn't work at all.
<P>
+Again, like <A HREF="../010/page01.html">Tutorial 10</A> we've skipped
+<i>THR_DETACHED</i> because we <i>wait()</i> for the threads to exit
+ elsewhere.
<P><HR WIDTH="100%">
<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page04.html">Continue This Tutorial</A>]</CENTER>
diff --git a/docs/tutorials/011/page04.html b/docs/tutorials/011/page04.html
index cd1092332b7..37c56c84a4e 100644
--- a/docs/tutorials/011/page04.html
+++ b/docs/tutorials/011/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/011/page05.html b/docs/tutorials/011/page05.html
index 51689bf5e04..d187b32173c 100644
--- a/docs/tutorials/011/page05.html
+++ b/docs/tutorials/011/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/011/page06.html b/docs/tutorials/011/page06.html
index 99f0c6632ff..b69ddc110d9 100644
--- a/docs/tutorials/011/page06.html
+++ b/docs/tutorials/011/page06.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/011/task.cpp b/docs/tutorials/011/task.cpp
index c0e95d21921..76d77caf860 100644
--- a/docs/tutorials/011/task.cpp
+++ b/docs/tutorials/011/task.cpp
@@ -24,15 +24,15 @@ Task::~Task (void)
message->release ();
}
-int
+int
Task::open (void *)
{
- return this->activate (THR_NEW_LWP,
+ return this->activate (THR_NEW_LWP,
this->n_threads_);
}
-int
+int
Task::close (u_long flags)
{
ACE_DEBUG ((LM_DEBUG,
@@ -41,7 +41,7 @@ Task::close (u_long flags)
return inherited::close (flags);
}
-int
+int
Task::svc (void)
{
this->barrier_.wait ();
@@ -70,7 +70,7 @@ Task::svc (void)
const char *cp = message->rd_ptr ();
// Don't forget to skip the NULL we inserted
- message->rd_ptr (ACE_OS::strlen (cp) + 1);
+ message->rd_ptr (ACE_OS::strlen (cp) + 1);
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) Block 0x%x contains (%s)\n",
diff --git a/docs/tutorials/011/task.h b/docs/tutorials/011/task.h
index c1883bb871a..2350b0be230 100644
--- a/docs/tutorials/011/task.h
+++ b/docs/tutorials/011/task.h
@@ -26,7 +26,7 @@ public:
protected:
ACE_Barrier barrier_;
-
+
size_t n_threads_;
};
diff --git a/docs/tutorials/012/combine.shar b/docs/tutorials/012/combine.shar
index c494cc309be..216258a44cc 100644
--- a/docs/tutorials/012/combine.shar
+++ b/docs/tutorials/012/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-01-26 20:15 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/012'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/012'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -69,7 +69,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh31139; then
+if mkdir _sh04999; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -462,5 +462,5 @@ SHAR_EOF
$echo 'page05.pst:' 'original size' '449,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh31139
+rm -fr _sh04999
exit 0
diff --git a/docs/tutorials/012/message_queue.cpp b/docs/tutorials/012/message_queue.cpp
index c8c1f60ed11..c5db97bb00b 100644
--- a/docs/tutorials/012/message_queue.cpp
+++ b/docs/tutorials/012/message_queue.cpp
@@ -32,7 +32,7 @@ int run_test (int iterations, int threads)
for (int i = 0; i < iterations; ++i)
{
/*
- Construct a Work object that we'll put into the Queue. Give it
+ Construct a Work object that we'll put into the Queue. Give it
the iteration number so that it can identify itself in the output.
*/
Work * data = new Work(i);
@@ -44,7 +44,7 @@ int run_test (int iterations, int threads)
Message_Block *message = new Message_Block (128, data);
/*
- As before, put a text message into the block.
+ As before, put a text message into the block.
*/
ACE_OS::sprintf (message->wr_ptr (), "This is message %d.", i);
message->wr_ptr (strlen (message->rd_ptr ())+1);
diff --git a/docs/tutorials/012/page01.html b/docs/tutorials/012/page01.html
index f54792048d4..7ece43c6de6 100644
--- a/docs/tutorials/012/page01.html
+++ b/docs/tutorials/012/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -15,13 +16,13 @@
<HR WIDTH="100%">
<P>
Last time around we put an object into a message queue by using the
-copy() method to create a duplicate of the object. That's probably OK
+copy() method to create a duplicate of the object. That's probably OK
for simple objects that aren't very large. However, if you have an
object that contains pointers or tons of data then that approach is
going to cause problems.
<P>
-What we'll do in this tutorial is specialize the ACE_Message_Block
-object so that it can carry our data more efficiently. As you'll see,
+What we'll do in this tutorial is specialize the ACE_Message_Block
+object so that it can carry our data more efficiently. As you'll see,
this isn't very difficult at all.
<P>
Kirthika's abstract:
diff --git a/docs/tutorials/012/page02.html b/docs/tutorials/012/page02.html
index 67d93863d18..362937b7395 100644
--- a/docs/tutorials/012/page02.html
+++ b/docs/tutorials/012/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -15,7 +16,7 @@
<HR WIDTH="100%">
We normally start by looking at main() and work our way out from
there. This time, I want to start by showing you the ACE_Message_Block
-derivative but before that, I have to introduce you to the Work object
+derivative but before that, I have to introduce you to the Work object
and it's baseclass Unit_Of_Work
<P>
<HR WIDTH="100%">
@@ -100,11 +101,11 @@ protected:
<HR WIDTH="100%">
<P>
This is basically the same as the <i>DataBase</i> in the previous
-tutorial but I've changed the name to be more generic. The feeling is
+tutorial but I've changed the name to be more generic. The feeling is
that a <i>Data</i> object would be a C struct but an <i>Work</i>
object would be a class with methods.
<P>
-Now that you know what we'll be putting into the queue, lets go to the
+Now that you know what we'll be putting into the queue, lets go to the
next page where I specialize the ACE_Message_Block.
<P>
<P><HR WIDTH="100%">
diff --git a/docs/tutorials/012/page03.html b/docs/tutorials/012/page03.html
index cff54395ec2..69b54f8ecf0 100644
--- a/docs/tutorials/012/page03.html
+++ b/docs/tutorials/012/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -15,11 +16,11 @@
<HR WIDTH="100%">
<P>
In the previous tutorial we moved our complex data into the queue by
-copy()ing it directly into the message block's data area. I hope that
+copy()ing it directly into the message block's data area. I hope that
most readers got a queasy feeling when I did that. It just isn't a
good idea...
<P>
-A better idea would be to teach the message queue about our data types
+A better idea would be to teach the message queue about our data types
(or at least a baseclass) so that it can more efficiently handle things:
<P>
<HR WIDTH="100%">
@@ -98,7 +99,7 @@ carry our data along. When our application is done with the message
block and release()es it, we know that our work object will also be
taken care of.
<P>
-Let's now go to main() and see what we had to change there to use this
+Let's now go to main() and see what we had to change there to use this
specialization.
<P>
<P><HR WIDTH="100%">
diff --git a/docs/tutorials/012/page04.html b/docs/tutorials/012/page04.html
index 75d8455f848..8823bd57c05 100644
--- a/docs/tutorials/012/page04.html
+++ b/docs/tutorials/012/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -53,7 +54,7 @@ int run_test (int iterations, int threads)
for (int i = 0; i &lt; iterations; ++i)
{
<font color=red>/*
- Construct a Work object that we'll put into the Queue. Give it
+ Construct a Work object that we'll put into the Queue. Give it
the iteration number so that it can identify itself in the output.
*/</font>
Work * data = new Work(i);
@@ -65,7 +66,7 @@ int run_test (int iterations, int threads)
Message_Block *message = new Message_Block (128, data);
<font color=red>/*
- As before, put a text message into the block.
+ As before, put a text message into the block.
*/</font>
<font color=#008888>ACE_OS::sprintf</font> (message->wr_ptr (), "<font color=green>This is message %d.</font>", i);
message->wr_ptr (strlen (message->rd_ptr ())+1);
diff --git a/docs/tutorials/012/page05.html b/docs/tutorials/012/page05.html
index dba97f08c41..14ca6ab4e8d 100644
--- a/docs/tutorials/012/page05.html
+++ b/docs/tutorials/012/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -14,7 +15,7 @@
<P>
<HR WIDTH="100%">
<P>
-The Task is the only object we've not been through yet. I'll go ahead
+The Task is the only object we've not been through yet. I'll go ahead
and show both the header and cpp on this one page since the header
isn't very large.
<P>
@@ -54,7 +55,7 @@ public:
<font color=red>/*
I really wanted this to be called open() but that was already
- claimed by the Task framework. start() will kick off our thread
+ claimed by the Task framework. start() will kick off our thread
pool for us.
*/</font>
int start (int threads = 1);
@@ -90,7 +91,7 @@ protected:
<font color=red>/*
You'll see in the svc() method that when we get a shutdown request,
- we always putq() it back into our message queue. The last thread in
+ we always putq() it back into our message queue. The last thread in
the pool will do this also and result in there always being one
shutdown request left in the queue when we get here. Just to be
polite, we'll go ahead and get that message and release it.
@@ -111,7 +112,7 @@ protected:
<font color=red>/*
The ACE_Barrier needs to know how many threads it will be working
- for. For that reason, we have to put off it's construction until we
+ for. For that reason, we have to put off it's construction until we
get here. We then pass the thread count through to our base class'
activate().
*/</font>
@@ -192,7 +193,7 @@ int <font color=#008888>Task::svc</font> (void)
unit_of_work = message_block->data();
<font color=red>/*
- Invoke a couple of method calls on the object we constructed.
+ Invoke a couple of method calls on the object we constructed.
*/</font>
unit_of_work->who_am_i ();
unit_of_work->what_am_i ();
@@ -201,14 +202,14 @@ int <font color=#008888>Task::svc</font> (void)
<font color=red>/*
Pretend that the work takes a little time to process. This
- prevents one thread from getting all of the action. In a real
+ prevents one thread from getting all of the action. In a real
system you wouldn't need to do this since the work really
would take time to complete.
*/</font>
<font color=#008888>ACE_OS::sleep</font> (ACE_Time_Value (0, 5000));
<font color=red>/*
- Release the message block and allow the unit of work to also go
+ Release the message block and allow the unit of work to also go
away.
*/</font>
message->release ();
@@ -219,13 +220,13 @@ int <font color=#008888>Task::svc</font> (void)
</PRE>
<HR WIDTH="100%">
<P>
-Like main() this is actually simpler than the previous tutorial. It's
+Like main() this is actually simpler than the previous tutorial. It's
much cleaner to carry around a pointer to the object we're working
with than to try copying data.
<P>
The only complication is the new ACE_Barrier. It's a pretty simple
object that makes it easy for you to synch threads in this way. You
-could do some fancy tricks with mutexes, counters & semaphores but why
+could do some fancy tricks with mutexes, counters & semaphores but why
bother when the Barrier already exists.
<P>
<P><HR WIDTH="100%">
diff --git a/docs/tutorials/012/page06.html b/docs/tutorials/012/page06.html
index 76f28616cd0..3cedea0d6b9 100644
--- a/docs/tutorials/012/page06.html
+++ b/docs/tutorials/012/page06.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/012/task.cpp b/docs/tutorials/012/task.cpp
index aea14e86a25..5f7d040237e 100644
--- a/docs/tutorials/012/task.cpp
+++ b/docs/tutorials/012/task.cpp
@@ -17,7 +17,7 @@ Task::Task (void)
/*
You'll see in the svc() method that when we get a shutdown request,
- we always putq() it back into our message queue. The last thread in
+ we always putq() it back into our message queue. The last thread in
the pool will do this also and result in there always being one
shutdown request left in the queue when we get here. Just to be
polite, we'll go ahead and get that message and release it.
@@ -38,7 +38,7 @@ Task::~Task (void)
/*
The ACE_Barrier needs to know how many threads it will be working
- for. For that reason, we have to put off it's construction until we
+ for. For that reason, we have to put off it's construction until we
get here. We then pass the thread count through to our base class'
activate().
*/
@@ -119,7 +119,7 @@ int Task::svc (void)
unit_of_work = message_block->data();
/*
- Invoke a couple of method calls on the object we constructed.
+ Invoke a couple of method calls on the object we constructed.
*/
unit_of_work->who_am_i ();
unit_of_work->what_am_i ();
@@ -128,14 +128,14 @@ int Task::svc (void)
/*
Pretend that the work takes a little time to process. This
- prevents one thread from getting all of the action. In a real
+ prevents one thread from getting all of the action. In a real
system you wouldn't need to do this since the work really
would take time to complete.
*/
ACE_OS::sleep (ACE_Time_Value (0, 5000));
/*
- Release the message block and allow the unit of work to also go
+ Release the message block and allow the unit of work to also go
away.
*/
message->release ();
diff --git a/docs/tutorials/012/task.h b/docs/tutorials/012/task.h
index bd2c20fda3c..afeed1bbf1d 100644
--- a/docs/tutorials/012/task.h
+++ b/docs/tutorials/012/task.h
@@ -31,7 +31,7 @@ public:
/*
I really wanted this to be called open() but that was already
- claimed by the Task framework. start() will kick off our thread
+ claimed by the Task framework. start() will kick off our thread
pool for us.
*/
int start (int threads = 1);
diff --git a/docs/tutorials/013/block.cpp b/docs/tutorials/013/block.cpp
index 5dd72a2013e..e652d33643a 100644
--- a/docs/tutorials/013/block.cpp
+++ b/docs/tutorials/013/block.cpp
@@ -6,7 +6,7 @@
/*
Construct a Dat_Block to contain a unit of work. Note the careful
construction of the baseclass to set the block type and the locking
- strategy.
+ strategy.
*/
Data_Block::Data_Block (Unit_Of_Work * _data)
: ACE_Data_Block (0, ACE_Message_Block::MB_DATA, 0, 0, new Lock (), 0, 0)
@@ -19,7 +19,7 @@ Data_Block::Data_Block (Unit_Of_Work * _data)
The Lock object created in the constructor is stored in the baseclass and
available through the locking_strategy() method. We can cast it's value to
our Lock object and invoke the destroy() to indicate that we want it to go
- away when the lock is released.
+ away when the lock is released.
*/
Data_Block::~Data_Block (void)
{
@@ -29,7 +29,7 @@ Data_Block::~Data_Block (void)
}
/*
- Return the data
+ Return the data
*/
Unit_Of_Work *Data_Block::data (void)
{
@@ -56,7 +56,7 @@ int Data_Block::Lock::destroy (void)
}
/*
- Create an baseclass unit of work when we instantiate a hangup message.
+ Create an baseclass unit of work when we instantiate a hangup message.
*/
Message_Block::Message_Block (void)
:ACE_Message_Block (new Data_Block (new Unit_Of_Work ()))
@@ -67,7 +67,7 @@ Message_Block::Message_Block (void)
/*
Store the unit of work in a Data_Block and initialize the baseclass with
- that data.
+ that data.
*/
Message_Block::Message_Block (Unit_Of_Work * _data)
:ACE_Message_Block (new Data_Block (_data))
diff --git a/docs/tutorials/013/block.h b/docs/tutorials/013/block.h
index e6c02e1e725..91261c3ecd0 100644
--- a/docs/tutorials/013/block.h
+++ b/docs/tutorials/013/block.h
@@ -57,7 +57,7 @@ protected:
// lock when we no longer need it. The method will then
// cleanup to prevent any memory leaks.
int destroy (void);
-
+
protected:
MLD;
};
diff --git a/docs/tutorials/013/combine.shar b/docs/tutorials/013/combine.shar
index feedd51e0a8..b640ea8da26 100644
--- a/docs/tutorials/013/combine.shar
+++ b/docs/tutorials/013/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-01-31 11:54 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/013'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/013'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -13,7 +13,7 @@
# ------ ---------- ------------------------------------------
# 386 -rw-rw-r-- hdr
# 89 -rw-rw-r-- bodies
-# 2415 -rw-rw-r-- page01.pre
+# 2416 -rw-rw-r-- page01.pre
# 432 -rw-rw-r-- page02.pre
# 1426 -rw-rw-r-- page03.pre
# 1049 -rw-rw-r-- page04.pre
@@ -71,7 +71,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh30349; then
+if mkdir _sh05033; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -203,12 +203,12 @@ SHAR_EOF
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page01.pre:' 'MD5 check failed'
-52884c61973afc64e96c907493ebc216 page01.pre
+2448d57199e11bc55ce9cb9cb3ada738 page01.pre
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page01.pre'`"
- test 2415 -eq "$shar_count" ||
- $echo 'page01.pre:' 'original size' '2415,' 'current size' "$shar_count!"
+ test 2416 -eq "$shar_count" ||
+ $echo 'page01.pre:' 'original size' '2416,' 'current size' "$shar_count!"
fi
fi
# ============= page02.pre ==============
@@ -657,5 +657,5 @@ SHAR_EOF
$echo 'page07.pst:' 'original size' '371,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh30349
+rm -fr _sh05033
exit 0
diff --git a/docs/tutorials/013/message_queue.cpp b/docs/tutorials/013/message_queue.cpp
index 4635304a460..67a22f7457b 100644
--- a/docs/tutorials/013/message_queue.cpp
+++ b/docs/tutorials/013/message_queue.cpp
@@ -10,7 +10,7 @@ int run_test (int iterations, int threads, int subtasks)
{
// Create a task with some subtasks. Each Task is a thread
// pool of 'threads' size. If a task has a subtask, it will
- // forward the unit of work to the subtask when finished. See
+ // forward the unit of work to the subtask when finished. See
// task.{h|cpp} for more details.
Task *task = new Task (subtasks);
@@ -84,5 +84,5 @@ template class ACE_Atomic_Op < ACE_Mutex, int >;
#pragma instantiate ACE_Lock_Adapter<ACE_Mutex>;
#pragma instantiate ACE_Atomic_Op<ACE_Mutex, int>;
#endif /*
- ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION
+ ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION
*/
diff --git a/docs/tutorials/013/page01.html b/docs/tutorials/013/page01.html
index f222eb01202..38149d1ff43 100644
--- a/docs/tutorials/013/page01.html
+++ b/docs/tutorials/013/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -24,11 +25,11 @@ method takes work units from the message queue for processing. As
each unit is taken from the queue, the process() method is invoked to
do some work. The twist is that after processing the message, we
enqueue it into another thread pool to do more work. This continues
-through a chain of thread pools until the last where the unit's fini()
+through a chain of thread pools until the last where the unit's fini()
method is called for finishing up any outstanding work.
<P>
The chain of thread pools is uni-directional using a singly-linked
-list of Task derivatives. Each pool has the same number of tasks in
+list of Task derivatives. Each pool has the same number of tasks in
order to keep things simple.
<P>
Kirthika's abstract:
@@ -44,12 +45,12 @@ traverses over the whole list. As a safety measure for destroying the
block after it goes through the whole list, an effective and simple
Memory Leak Detector has been implemented. It is a counter which
increments when the object where it resides is created and decrements on
-its deletion.
+its deletion.
<P>
Another optimisation from the previous tutorials on Message Queues, is
the bundling of the Data block within the Message Block. The Data block
provides reference counting, so duplication of data is avoided. It is
-deleted only when its reference count drops to zero. Now updating
+deleted only when its reference count drops to zero. Now updating
this count between threads call for synchronisation and in comes the
ACE_Mutex, a lock which takes care that the counting is thread-safe.
<P>
diff --git a/docs/tutorials/013/page02.html b/docs/tutorials/013/page02.html
index 85475ae7709..39cfd5daf5f 100644
--- a/docs/tutorials/013/page02.html
+++ b/docs/tutorials/013/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -109,7 +110,7 @@ template class ACE_Atomic_Op &lt; ACE_Mutex, int >;
<font color=blue>#pragma</font> <font color=purple>instantiate</font> ACE_Lock_Adapter&lt;ACE_Mutex>;
<font color=blue>#pragma</font> <font color=purple>instantiate</font> ACE_Atomic_Op&lt;ACE_Mutex, int>;
<font color=blue>#endif</font> <font color=red>/*
- ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION
+ ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION
*/</font>
</PRE>
<HR WIDTH="100%">
diff --git a/docs/tutorials/013/page03.html b/docs/tutorials/013/page03.html
index 05264a8b6aa..d880cf2d449 100644
--- a/docs/tutorials/013/page03.html
+++ b/docs/tutorials/013/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -26,8 +27,8 @@ On the other hand, if you're passing data between several threads, it
is easy to loose track of who "owns" the data at any one time. All
too frequently, data will be deleted by one thread while another is
still using it. Reference counting can prevent that. The rule of
-thumb is that you increment the reference count of the object when you
-hand it off to a new thread. You then decrement the count when you're
+thumb is that you increment the reference count of the object when you
+hand it off to a new thread. You then decrement the count when you're
done with the object and let the object delete itself when there are
no more references.
<P>
diff --git a/docs/tutorials/013/page04.html b/docs/tutorials/013/page04.html
index 3e3b8f5d56e..5660a8675cb 100644
--- a/docs/tutorials/013/page04.html
+++ b/docs/tutorials/013/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -32,7 +33,7 @@ itself.
<P>
To increment the reference count of a data block, use the
duplicate() method of the message block (or blocks) to get a new
-message block referencing the same data block. This is very efficient
+message block referencing the same data block. This is very efficient
since the actual data is not copied.
<P>
<HR WIDTH="100%">
@@ -96,7 +97,7 @@ protected:
<font color=red>// lock when we no longer need it. The method will then</font>
<font color=red>// cleanup to prevent any memory leaks.</font>
int destroy (void);
-
+
protected:
MLD;
};
diff --git a/docs/tutorials/013/page05.html b/docs/tutorials/013/page05.html
index 95588ff8590..48e9742f864 100644
--- a/docs/tutorials/013/page05.html
+++ b/docs/tutorials/013/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -29,7 +30,7 @@ the Data_Block.
<font color=red>/*
Construct a Dat_Block to contain a unit of work. Note the careful
construction of the baseclass to set the block type and the locking
- strategy.
+ strategy.
*/</font>
<font color=#008888>Data_Block::Data_Block</font> (Unit_Of_Work * _data)
: ACE_Data_Block (0, <font color=#008888>ACE_Message_Block::MB_DATA</font>, 0, 0, new Lock (), 0, 0)
@@ -42,7 +43,7 @@ the Data_Block.
The Lock object created in the constructor is stored in the baseclass and
available through the locking_strategy() method. We can cast it's value to
our Lock object and invoke the destroy() to indicate that we want it to go
- away when the lock is released.
+ away when the lock is released.
*/</font>
<font color=#008888>Data_Block::~Data_Block</font> (void)
{
@@ -52,7 +53,7 @@ the Data_Block.
}
<font color=red>/*
- Return the data
+ Return the data
*/</font>
Unit_Of_Work *<font color=#008888>Data_Block::data</font> (void)
{
@@ -79,7 +80,7 @@ int <font color=#008888>Data_Block::Lock</font>::destroy (void)
}
<font color=red>/*
- Create an baseclass unit of work when we instantiate a hangup message.
+ Create an baseclass unit of work when we instantiate a hangup message.
*/</font>
<font color=#008888>Message_Block::Message_Block</font> (void)
:ACE_Message_Block (new Data_Block (new Unit_Of_Work ()))
@@ -90,7 +91,7 @@ int <font color=#008888>Data_Block::Lock</font>::destroy (void)
<font color=red>/*
Store the unit of work in a Data_Block and initialize the baseclass with
- that data.
+ that data.
*/</font>
<font color=#008888>Message_Block::Message_Block</font> (Unit_Of_Work * _data)
:ACE_Message_Block (new Data_Block (_data))
diff --git a/docs/tutorials/013/page06.html b/docs/tutorials/013/page06.html
index 4e2ccf5c255..d6ef1d7270e 100644
--- a/docs/tutorials/013/page06.html
+++ b/docs/tutorials/013/page06.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -70,7 +71,7 @@ public:
<font color=red>/*
I really wanted this to be called open() but that was already
- claimed by the Task framework. start() will kick off our thread
+ claimed by the Task framework. start() will kick off our thread
pool for us.
*/</font>
int start (int threads = 1);
@@ -105,7 +106,7 @@ protected:
<font color=red>/*
Construct the Task with zero or more subtasks. If subtasks are requested,
we assign our next_ pointer to the first of those and let it worry about
- any remaining subtasks.
+ any remaining subtasks.
*/</font>
<font color=#008888>Task::Task</font> (int sub_tasks)
: barrier_ (0)
@@ -119,7 +120,7 @@ protected:
}
<font color=red>/*
- Delete our barrier object and any subtasks we may have.
+ Delete our barrier object and any subtasks we may have.
*/</font>
<font color=#008888>Task::~Task</font> (void)
{
@@ -131,8 +132,8 @@ protected:
<font color=red>/*
Open our thread pool with the requested number of threads. If subtasks are
- enabled, they inherit the thread-pool size. Make sure that the subtasks can
- be opened before we open our own threadpool.
+ enabled, they inherit the thread-pool size. Make sure that the subtasks can
+ be opened before we open our own threadpool.
*/</font>
int <font color=#008888>Task::start</font> (int threads)
{
@@ -149,8 +150,8 @@ int <font color=#008888>Task::start</font> (int threads)
}
<font color=red>/*
- Close ourselves and any subtasks. This just prints a message so that we can
- assure ourselves things are cleaned up correctly.
+ Close ourselves and any subtasks. This just prints a message so that we can
+ assure ourselves things are cleaned up correctly.
*/</font>
int <font color=#008888>Task::close</font> (u_long flags)
{
@@ -166,7 +167,7 @@ int <font color=#008888>Task::close</font> (u_long flags)
<font color=red>/*
Wait for all of the threads in our pool to exit and then wait for any
subtasks. When called from the front of the task chain, this won't return
- until all thread pools in the chain have exited.
+ until all thread pools in the chain have exited.
*/</font>
int <font color=#008888>Task::wait</font> (void)
{
@@ -179,7 +180,7 @@ int <font color=#008888>Task::wait</font> (void)
}
<font color=red>/*
- Like the thread-pools before, this is where all of the work is done.
+ Like the thread-pools before, this is where all of the work is done.
*/</font>
int <font color=#008888>Task::svc</font> (void)
{
@@ -192,16 +193,16 @@ int <font color=#008888>Task::svc</font> (void)
<font color=red>// of those. We could do some casting (or even auto-casting) to</font>
<font color=red>// avoid the extra variable but I prefer to be clear about our actions.</font>
ACE_Message_Block *message;
-
+
<font color=red>// What we really put into the queue was our Message_Block.</font>
<font color=red>// After we get the message from the queue, we'll cast it to this </font>
<font color=red>// so that we know how to work on it.</font>
Message_Block *message_block;
-
+
<font color=red>// And, of course, our Message_Block contains our Data_Block</font>
<font color=red>// instead of the typical ACE_Data_Block</font>
Data_Block *data_block;
-
+
<font color=red>// Even though we put Work objects into the queue, we take them</font>
<font color=red>// out using the baseclass pointer. This allows us to create new </font>
<font color=red>// derivatives without having to change this svc() method.</font>
@@ -295,7 +296,7 @@ So you see... it wasn't really that much more complicated. We really
just have to remember to pass to <i>next_</i> when we finish working
on the data. If your Unit_Of_Work derivative is going to implement a
state machine be sure that you also implement a fini() method
-<em>or</em> ensure that your chain of subtasks is large enough for all
+<em>or</em> ensure that your chain of subtasks is large enough for all
possible states.
<P>
<P><HR WIDTH="100%">
diff --git a/docs/tutorials/013/page07.html b/docs/tutorials/013/page07.html
index 509e326adf9..d2e22b2bdde 100644
--- a/docs/tutorials/013/page07.html
+++ b/docs/tutorials/013/page07.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -16,23 +17,23 @@
<P>
I've been trying to justify the chain of tasks by talking about a
Work object that implements a state machine. The idea is that your
-Work object has to perform a series of discrete steps to complete it's
+Work object has to perform a series of discrete steps to complete it's
function. Traditionally, all of those steps would take place in one
thread of execution. That thread would probably be one from a Task
thread pool.
<P>
-Suppose, however, that some of those steps spend a lot of time waiting
-for disk IO. You could find that all of your thread-pool threads
+Suppose, however, that some of those steps spend a lot of time waiting
+for disk IO. You could find that all of your thread-pool threads
are just sitting there waiting for the disk. You might then be
tempted to increase the thread pool size to get more work through.
-However, if some of the stages are memory intensive, you could run out
+However, if some of the stages are memory intensive, you could run out
of memory if all of the workers get to that state at the same time.
<P>
One solution might be to have different thread pools for each state.
Each pool could have it's size tuned appropriately for the work that
-would be done there. That's where the chain of Tasks comes in.
- In this tutorial's implementation I've taken the
-easy route and set all of the thread pools to the same size but a more
+would be done there. That's where the chain of Tasks comes in.
+ In this tutorial's implementation I've taken the
+easy route and set all of the thread pools to the same size but a more
realistic solution would be to set each thread pool in the chain to a
specific size as needed by that state of operation.
<P>
@@ -123,7 +124,7 @@ protected:
<font color=blue>#include</font> "<font color=green>work.h</font>"
<font color=red>/*
- Initialize the state to zero
+ Initialize the state to zero
*/</font>
<font color=#008888>Unit_Of_Work::Unit_Of_Work</font> (void)
: state_ (0)
@@ -137,7 +138,7 @@ protected:
}
<font color=red>/*
- Display our instance value
+ Display our instance value
*/</font>
void <font color=#008888>Unit_Of_Work::who_am_i</font> (void)
{
@@ -145,7 +146,7 @@ void <font color=#008888>Unit_Of_Work::who_am_i</font> (void)
}
<font color=red>/*
- Dispay our type name
+ Dispay our type name
*/</font>
void <font color=#008888>Unit_Of_Work::what_am_i</font> (void)
{
@@ -153,7 +154,7 @@ void <font color=#008888>Unit_Of_Work::what_am_i</font> (void)
}
<font color=red>/*
- Return failure. You should always derive from Unit_Of_Work...
+ Return failure. You should always derive from Unit_Of_Work...
*/</font>
int <font color=#008888>Unit_Of_Work::process</font> (void)
{
@@ -161,7 +162,7 @@ int <font color=#008888>Unit_Of_Work::process</font> (void)
}
<font color=red>/*
- ditto
+ ditto
*/</font>
int <font color=#008888>Unit_Of_Work::fini</font> (void)
{
@@ -169,7 +170,7 @@ int <font color=#008888>Unit_Of_Work::fini</font> (void)
}
<font color=red>/*
- Default constructor has no "<font color=green>message number</font>"
+ Default constructor has no "<font color=green>message number</font>"
*/</font>
<font color=#008888>Work::Work</font> (void)
:message_ (-1)
@@ -179,7 +180,7 @@ int <font color=#008888>Unit_Of_Work::fini</font> (void)
<font color=red>/*
The useful constructor remembers which message it is and will tell you if
- you ask.
+ you ask.
*/</font>
<font color=#008888>Work::Work</font> (int message)
: message_ (message)
@@ -193,7 +194,7 @@ int <font color=#008888>Unit_Of_Work::fini</font> (void)
}
<font color=red>/*
- This objects type name is different from the baseclass
+ This objects type name is different from the baseclass
*/</font>
void <font color=#008888>Work::what_am_i</font> (void)
{
@@ -202,7 +203,7 @@ void <font color=#008888>Work::what_am_i</font> (void)
<font color=red>/*
A very simple state machine that just walks through three stages. If it is
- called more than that, it will tell you not to bother.
+ called more than that, it will tell you not to bother.
*/</font>
int <font color=#008888>Work::process</font> (void)
{
@@ -227,8 +228,8 @@ int <font color=#008888>Work::process</font> (void)
<font color=red>/*
If you don't have enough subtasks in the chain then the state machine won't
- progress to the end. The fini() hook will allow us to recover from that by
- executing the remaining states in the final task of the chain.
+ progress to the end. The fini() hook will allow us to recover from that by
+ executing the remaining states in the final task of the chain.
*/</font>
int <font color=#008888>Work::fini</font> (void)
{
@@ -247,9 +248,9 @@ int <font color=#008888>Work::fini</font> (void)
<P>
And that is that. For a more complex machine that may want to "jump
states" you would have to set some "state information" (sorry, bad
-choice of terminology again) so that process() could decide what to do
+choice of terminology again) so that process() could decide what to do
at each call. You might also modify Task::svc() so that it will
-respect the return value of process() and do something useful with the
+respect the return value of process() and do something useful with the
information.
<P>
<P><HR WIDTH="100%">
diff --git a/docs/tutorials/013/page08.html b/docs/tutorials/013/page08.html
index a2780b54482..ebede97f796 100644
--- a/docs/tutorials/013/page08.html
+++ b/docs/tutorials/013/page08.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -14,8 +15,8 @@
<P>
<HR WIDTH="100%">
<P>
-And that's the end of another tutorial. This one is probably the most
-complicated so far because I've introduced or expanded upon
+And that's the end of another tutorial. This one is probably the most
+complicated so far because I've introduced or expanded upon
a number of different
concepts. Namely: state machines, reference counting and task
chaining. I hope I didn't complicate things to the point where the
diff --git a/docs/tutorials/013/task.cpp b/docs/tutorials/013/task.cpp
index 75c0a0d3341..37af6f8072f 100644
--- a/docs/tutorials/013/task.cpp
+++ b/docs/tutorials/013/task.cpp
@@ -8,7 +8,7 @@
/*
Construct the Task with zero or more subtasks. If subtasks are requested,
we assign our next_ pointer to the first of those and let it worry about
- any remaining subtasks.
+ any remaining subtasks.
*/
Task::Task (int sub_tasks)
: barrier_ (0)
@@ -22,7 +22,7 @@ Task::Task (int sub_tasks)
}
/*
- Delete our barrier object and any subtasks we may have.
+ Delete our barrier object and any subtasks we may have.
*/
Task::~Task (void)
{
@@ -34,8 +34,8 @@ Task::~Task (void)
/*
Open our thread pool with the requested number of threads. If subtasks are
- enabled, they inherit the thread-pool size. Make sure that the subtasks can
- be opened before we open our own threadpool.
+ enabled, they inherit the thread-pool size. Make sure that the subtasks can
+ be opened before we open our own threadpool.
*/
int Task::start (int threads)
{
@@ -52,8 +52,8 @@ int Task::start (int threads)
}
/*
- Close ourselves and any subtasks. This just prints a message so that we can
- assure ourselves things are cleaned up correctly.
+ Close ourselves and any subtasks. This just prints a message so that we can
+ assure ourselves things are cleaned up correctly.
*/
int Task::close (u_long flags)
{
@@ -69,7 +69,7 @@ int Task::close (u_long flags)
/*
Wait for all of the threads in our pool to exit and then wait for any
subtasks. When called from the front of the task chain, this won't return
- until all thread pools in the chain have exited.
+ until all thread pools in the chain have exited.
*/
int Task::wait (void)
{
@@ -82,7 +82,7 @@ int Task::wait (void)
}
/*
- Like the thread-pools before, this is where all of the work is done.
+ Like the thread-pools before, this is where all of the work is done.
*/
int Task::svc (void)
{
@@ -95,18 +95,18 @@ int Task::svc (void)
// of those. We could do some casting (or even auto-casting) to
// avoid the extra variable but I prefer to be clear about our actions.
ACE_Message_Block *message;
-
+
// What we really put into the queue was our Message_Block.
- // After we get the message from the queue, we'll cast it to this
+ // After we get the message from the queue, we'll cast it to this
// so that we know how to work on it.
Message_Block *message_block;
-
+
// And, of course, our Message_Block contains our Data_Block
// instead of the typical ACE_Data_Block
Data_Block *data_block;
-
+
// Even though we put Work objects into the queue, we take them
- // out using the baseclass pointer. This allows us to create new
+ // out using the baseclass pointer. This allows us to create new
// derivatives without having to change this svc() method.
Unit_Of_Work *work;
@@ -154,7 +154,7 @@ int Task::svc (void)
}
// We're now done with our copy of the block, so we can
- // release it. Our peers/subtasks have their own message
+ // release it. Our peers/subtasks have their own message
// block to access the shared data blocks.
message_block->release ();
@@ -168,7 +168,7 @@ int Task::svc (void)
if (next_)
{
// If we have subtasks, we pass the block on to them. Notice
- // that I don't bother to duplicate() the block since I won't
+ // that I don't bother to duplicate() the block since I won't
// release it in this case. I could have invoked
// duplicate() in the puq() and then release()
// afterwards. Either is acceptable.
diff --git a/docs/tutorials/013/task.h b/docs/tutorials/013/task.h
index 64f4064dfa0..c111333b022 100644
--- a/docs/tutorials/013/task.h
+++ b/docs/tutorials/013/task.h
@@ -33,7 +33,7 @@ public:
/*
I really wanted this to be called open() but that was already
- claimed by the Task framework. start() will kick off our thread
+ claimed by the Task framework. start() will kick off our thread
pool for us.
*/
int start (int threads = 1);
diff --git a/docs/tutorials/013/work.cpp b/docs/tutorials/013/work.cpp
index f4dc932d003..ac2920fec90 100644
--- a/docs/tutorials/013/work.cpp
+++ b/docs/tutorials/013/work.cpp
@@ -4,7 +4,7 @@
#include "work.h"
/*
- Initialize the state to zero
+ Initialize the state to zero
*/
Unit_Of_Work::Unit_Of_Work (void)
: state_ (0)
@@ -18,7 +18,7 @@ Unit_Of_Work::~Unit_Of_Work (void)
}
/*
- Display our instance value
+ Display our instance value
*/
void Unit_Of_Work::who_am_i (void)
{
@@ -26,7 +26,7 @@ void Unit_Of_Work::who_am_i (void)
}
/*
- Dispay our type name
+ Dispay our type name
*/
void Unit_Of_Work::what_am_i (void)
{
@@ -34,7 +34,7 @@ void Unit_Of_Work::what_am_i (void)
}
/*
- Return failure. You should always derive from Unit_Of_Work...
+ Return failure. You should always derive from Unit_Of_Work...
*/
int Unit_Of_Work::process (void)
{
@@ -42,7 +42,7 @@ int Unit_Of_Work::process (void)
}
/*
- ditto
+ ditto
*/
int Unit_Of_Work::fini (void)
{
@@ -50,7 +50,7 @@ int Unit_Of_Work::fini (void)
}
/*
- Default constructor has no "message number"
+ Default constructor has no "message number"
*/
Work::Work (void)
:message_ (-1)
@@ -60,7 +60,7 @@ Work::Work (void)
/*
The useful constructor remembers which message it is and will tell you if
- you ask.
+ you ask.
*/
Work::Work (int message)
: message_ (message)
@@ -74,7 +74,7 @@ Work::~Work (void)
}
/*
- This objects type name is different from the baseclass
+ This objects type name is different from the baseclass
*/
void Work::what_am_i (void)
{
@@ -83,7 +83,7 @@ void Work::what_am_i (void)
/*
A very simple state machine that just walks through three stages. If it is
- called more than that, it will tell you not to bother.
+ called more than that, it will tell you not to bother.
*/
int Work::process (void)
{
@@ -108,8 +108,8 @@ int Work::process (void)
/*
If you don't have enough subtasks in the chain then the state machine won't
- progress to the end. The fini() hook will allow us to recover from that by
- executing the remaining states in the final task of the chain.
+ progress to the end. The fini() hook will allow us to recover from that by
+ executing the remaining states in the final task of the chain.
*/
int Work::fini (void)
{
diff --git a/docs/tutorials/014/EndTask.h b/docs/tutorials/014/EndTask.h
index f1c6a22a1aa..a8bab2698b5 100644
--- a/docs/tutorials/014/EndTask.h
+++ b/docs/tutorials/014/EndTask.h
@@ -34,7 +34,7 @@ class EndTask : public Task
public:
typedef Task inherited;
- EndTask (const char *nameOfTask): inherited (nameOfTask, 0)
+ EndTask (const char *nameOfTask): inherited (nameOfTask, 0)
{
// when we get open()'d, it with 0 threads since there is actually
// no processing to do.
@@ -63,12 +63,12 @@ public:
return 0;
}
- virtual ~EndTask(void)
+ virtual ~EndTask(void)
{
}
virtual int put (ACE_Message_Block *message,
- ACE_Time_Value *timeout)
+ ACE_Time_Value *timeout)
{
ACE_DEBUG ((LM_INFO,
"(%P|%t) Line: %d, File: %s\n",
diff --git a/docs/tutorials/014/Task.cpp b/docs/tutorials/014/Task.cpp
index 51b4e540be5..ceb587b2a4d 100644
--- a/docs/tutorials/014/Task.cpp
+++ b/docs/tutorials/014/Task.cpp
@@ -28,21 +28,17 @@ Task::~Task(void)
ACE_DEBUG ((LM_DEBUG, "(%P|%t) %s Task::~Task() -- once per Task\n", d_nameOfTask));
}
-int Task::open(void *arg)
+int Task::open(void *arg)
{
ACE_UNUSED_ARG(arg);
ACE_DEBUG ((LM_DEBUG, "(%P|%t) %s Task::open() -- once per Task\n", d_nameOfTask));
-
+
// call ACE_Task::activate() to spawn the threads using
// our Task::svc() as the function to be run.
- // FMM -- Frequently Made Mistake --
- //
- // If you specify the flag THR_DETACHED when activating the
- // Task, you will get an assert() violation during close(),
- // since the Task waits for all of its threads to rejoin.
- //
+ // No need to use THR_DETACHED here, we're going to wait()
+ // for the threads to exit later. No leaks.
return this->activate(THR_NEW_LWP, d_numberOfThreads);
}
@@ -55,7 +51,7 @@ int Task::put(ACE_Message_Block *message,
// directly to our putq() method, so that Messages put() to us
// will appear in the Message_Queue that is checked by the
// service threads.
-
+
return this->putq(message, timeout);
}
@@ -81,24 +77,24 @@ int Task::close(u_long flags)
ACE_Message_Block *hangupBlock = new ACE_Message_Block();
- // And make it of the type MB_HANGUP.
+ // And make it of the type MB_HANGUP.
hangupBlock->msg_type(ACE_Message_Block::MB_HANGUP);
- // We then send this Block into the Message_Queue to be seen by the
+ // We then send this Block into the Message_Queue to be seen by the
// service threads.
// Once again we duplicate() the Block as send it off...
-
+
if (this->putq(hangupBlock->duplicate()) == -1) {
ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "Task::close() putq"), -1);
}
-
+
// ..and we're free to release() our copy of it.
hangupBlock->release();
- // Now, all we have to do is wait() for the service threads to all
+ // Now, all we have to do is wait() for the service threads to all
// exit. This is where using THR_DETACHED in the activate() method
// will come back to haunt you.
@@ -148,7 +144,7 @@ int Task::svc(void)
}
if (messageBlock->msg_type() == ACE_Message_Block::MB_HANGUP) {
-
+
// If the Message_Block is of type MB_HANGUP, then we're being asked
// to shut down nicely.
@@ -169,7 +165,7 @@ int Task::svc(void)
break;
}
- // If we're here, then we've received a Message_Block that was
+ // If we're here, then we've received a Message_Block that was
// not informing us to quit, so we're assuming it's a valid
// meaningful Block.
@@ -186,13 +182,13 @@ int Task::svc(void)
ACE_OS::sleep (ACE_Time_Value (0, 250));
- // Since we're part of a Stream, we duplicate the Block, and
+ // Since we're part of a Stream, we duplicate the Block, and
// send it on to the next Task.
if (put_next(messageBlock->duplicate()) == -1) {
ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "Task::svc() put_next"), -1);
}
-
+
// And then we release our copy of it.
messageBlock->release();
diff --git a/docs/tutorials/014/page03.html b/docs/tutorials/014/page03.html
index 114179dd170..d2acd95ca70 100644
--- a/docs/tutorials/014/page03.html
+++ b/docs/tutorials/014/page03.html
@@ -58,21 +58,17 @@ Like our other tutorials, svc() looks for a hangup and processes data.
ACE_DEBUG ((LM_DEBUG, "<font color=green>(%P|%t) %s <font color=#008888>Task::~Task</font>() -- once per Task\n</font>", d_nameOfTask));
}
-int <font color=#008888>Task::open</font>(void *arg)
+int <font color=#008888>Task::open</font>(void *arg)
{
ACE_UNUSED_ARG(arg);
ACE_DEBUG ((LM_DEBUG, "<font color=green>(%P|%t) %s <font color=#008888>Task::open</font>() -- once per Task\n</font>", d_nameOfTask));
-
+
<font color=red>// call <font color=#008888>ACE_Task::activate</font>() to spawn the threads using</font>
<font color=red>// our <font color=#008888>Task::svc</font>() as the function to be run.</font>
- <font color=red>// FMM -- Frequently Made Mistake --</font>
- <font color=red>// </font>
- <font color=red>// If you specify the flag THR_DETACHED when activating the</font>
- <font color=red>// Task, you will get an assert() violation during close(),</font>
- <font color=red>// since the Task waits for all of its threads to rejoin.</font>
- <font color=red>// </font>
+ <font color=red>// No need to use THR_DETACHED here, we're going to wait()</font>
+ <font color=red>// for the threads to exit later. No leaks.</font>
return this->activate(THR_NEW_LWP, d_numberOfThreads);
}
@@ -85,7 +81,7 @@ int <font color=#008888>Task::put</font>(ACE_Message_Block *message,
<font color=red>// directly to our putq() method, so that Messages put() to us</font>
<font color=red>// will appear in the Message_Queue that is checked by the</font>
<font color=red>// service threads.</font>
-
+
return this->putq(message, timeout);
}
@@ -111,24 +107,24 @@ int <font color=#008888>Task::close</font>(u_long flags)
ACE_Message_Block *hangupBlock = new ACE_Message_Block();
- <font color=red>// And make it of the type MB_HANGUP. </font>
+ <font color=red>// And make it of the type MB_HANGUP.</font>
hangupBlock->msg_type(<font color=#008888>ACE_Message_Block::MB_HANGUP</font>);
- <font color=red>// We then send this Block into the Message_Queue to be seen by the </font>
+ <font color=red>// We then send this Block into the Message_Queue to be seen by the</font>
<font color=red>// service threads.</font>
<font color=red>// Once again we duplicate() the Block as send it off...</font>
-
+
if (this->putq(hangupBlock->duplicate()) == -1) {
ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green><font color=#008888>Task::close</font>() putq</font>"), -1);
}
-
+
<font color=red>// ..and we're free to release() our copy of it.</font>
hangupBlock->release();
- <font color=red>// Now, all we have to do is wait() for the service threads to all </font>
+ <font color=red>// Now, all we have to do is wait() for the service threads to all</font>
<font color=red>// exit. This is where using THR_DETACHED in the activate() method</font>
<font color=red>// will come back to haunt you.</font>
@@ -178,7 +174,7 @@ int <font color=#008888>Task::svc</font>(void)
}
if (messageBlock->msg_type() == <font color=#008888>ACE_Message_Block::MB_HANGUP</font>) {
-
+
<font color=red>// If the Message_Block is of type MB_HANGUP, then we're being asked</font>
<font color=red>// to shut down nicely.</font>
@@ -199,7 +195,7 @@ int <font color=#008888>Task::svc</font>(void)
break;
}
- <font color=red>// If we're here, then we've received a Message_Block that was </font>
+ <font color=red>// If we're here, then we've received a Message_Block that was</font>
<font color=red>// not informing us to quit, so we're assuming it's a valid</font>
<font color=red>// meaningful Block.</font>
@@ -216,13 +212,13 @@ int <font color=#008888>Task::svc</font>(void)
<font color=#008888>ACE_OS::sleep</font> (ACE_Time_Value (0, 250));
- <font color=red>// Since we're part of a Stream, we duplicate the Block, and </font>
+ <font color=red>// Since we're part of a Stream, we duplicate the Block, and</font>
<font color=red>// send it on to the next Task.</font>
if (put_next(messageBlock->duplicate()) == -1) {
ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green><font color=#008888>Task::svc</font>() put_next</font>"), -1);
}
-
+
<font color=red>// And then we release our copy of it.</font>
messageBlock->release();
diff --git a/docs/tutorials/014/page04.html b/docs/tutorials/014/page04.html
index 78bb47373d0..76c784b780a 100644
--- a/docs/tutorials/014/page04.html
+++ b/docs/tutorials/014/page04.html
@@ -60,7 +60,7 @@ class EndTask : public Task
public:
typedef Task inherited;
- EndTask (const char *nameOfTask): inherited (nameOfTask, 0)
+ EndTask (const char *nameOfTask): inherited (nameOfTask, 0)
{
<font color=red>// when we get open()'d, it with 0 threads since there is actually</font>
<font color=red>// no processing to do.</font>
@@ -89,12 +89,12 @@ public:
return 0;
}
- virtual ~EndTask(void)
+ virtual ~EndTask(void)
{
}
virtual int put (ACE_Message_Block *message,
- ACE_Time_Value *timeout)
+ ACE_Time_Value *timeout)
{
ACE_DEBUG ((LM_INFO,
"<font color=green>(%P|%t) Line: %d, File: %s\n</font>",
diff --git a/docs/tutorials/014/page05.html b/docs/tutorials/014/page05.html
index d54bab00c84..ca647ed5e20 100644
--- a/docs/tutorials/014/page05.html
+++ b/docs/tutorials/014/page05.html
@@ -118,7 +118,7 @@ int main(int argc, char *argv[])
moduleEnd = new Module("<font color=green>Module End</font>", taskEnd);
<font color=red>// Now we push the Modules onto the Stream.</font>
- <font color=red>// Pushing adds the module to the head, or </font>
+ <font color=red>// Pushing adds the module to the head, or</font>
<font color=red>// otherwise prepends it to whatever modules</font>
<font color=red>// are already installed.</font>
@@ -127,7 +127,7 @@ int main(int argc, char *argv[])
if (theStream.push(moduleEnd) == -1) {
ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green>push</font>"), -1);
- }
+ }
if (theStream.push(moduleFour) == -1) {
ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green>push</font>"), -1);
@@ -195,11 +195,11 @@ int main(int argc, char *argv[])
<font color=red>// The Stream will automagically delete the Modules and</font>
<font color=red>// the contained Tasks. We don't have to do that.</font>
<font color=red>//</font>
- <font color=red>// This call will block (due to the way we've written our </font>
+ <font color=red>// This call will block (due to the way we've written our</font>
<font color=red>// Task class) until all Message_Blocks have cleared the</font>
<font color=red>// entire Stream, and all associated threads have exited.</font>
- theStream.close();
+ theStream.close();
return 0;
}
diff --git a/docs/tutorials/014/page06.html b/docs/tutorials/014/page06.html
deleted file mode 100644
index 3bbff685aa8..00000000000
--- a/docs/tutorials/014/page06.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="Author" CONTENT="Bob McWhirter">
- <TITLE>ACE Tutorial 014</TITLE>
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F">
-
-<CENTER><B><FONT SIZE=+2>ACE Tutorial 014</FONT></B></CENTER>
-
-<CENTER><B><FONT SIZE=+2>ACE_Stream Tutorial, Of Sorts</FONT></B></CENTER>
-
-<P>
-<HR WIDTH="100%">
-
-Ok, so that's the Stream tutorial. As you can see, it's much simpler
- than the task-chain developed last time but at the same time it
- is also much more extensible.
-
-<UL>
-<LI><A HREF="Makefile">Makefile</A>
-<LI><A HREF="Task.h">Task.h</A>
-<LI><A HREF="Task.cpp">Task.cpp</A>
-<LI><A HREF="EndTask.h">EndTask.h</A>
-<LI><A HREF="stream.cpp">stream.cpp</A>
-</UL>
-<P><HR WIDTH="100%">
-<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] </CENTER>
diff --git a/docs/tutorials/014/stream.cpp b/docs/tutorials/014/stream.cpp
index 39c5eaed296..0e2b784b2f8 100644
--- a/docs/tutorials/014/stream.cpp
+++ b/docs/tutorials/014/stream.cpp
@@ -81,7 +81,7 @@ int main(int argc, char *argv[])
moduleEnd = new Module("Module End", taskEnd);
// Now we push the Modules onto the Stream.
- // Pushing adds the module to the head, or
+ // Pushing adds the module to the head, or
// otherwise prepends it to whatever modules
// are already installed.
@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
if (theStream.push(moduleEnd) == -1) {
ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "push"), -1);
- }
+ }
if (theStream.push(moduleFour) == -1) {
ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "push"), -1);
@@ -158,11 +158,11 @@ int main(int argc, char *argv[])
// The Stream will automagically delete the Modules and
// the contained Tasks. We don't have to do that.
//
- // This call will block (due to the way we've written our
+ // This call will block (due to the way we've written our
// Task class) until all Message_Blocks have cleared the
// entire Stream, and all associated threads have exited.
- theStream.close();
+ theStream.close();
return 0;
}
diff --git a/docs/tutorials/015/Compressor.cpp b/docs/tutorials/015/Compressor.cpp
index 931264d716c..3e9a6596d89 100644
--- a/docs/tutorials/015/Compressor.cpp
+++ b/docs/tutorials/015/Compressor.cpp
@@ -31,7 +31,7 @@ int Compressor::send(ACE_Message_Block *message, ACE_Time_Value *timeout)
ACE_Message_Block * compressed = new ACE_Message_Block( message->size() );
// Perform a bogus compression algorithm. 'CD' just tells me
- // that this is compressed data and when we "decompress" we'll
+ // that this is compressed data and when we "decompress" we'll
// look for this signature to validate the data received.
ACE_OS::sprintf( compressed->wr_ptr(), "CD:%s", message->rd_ptr() );
compressed->wr_ptr( strlen(compressed->wr_ptr())+1 );
@@ -45,7 +45,7 @@ int Compressor::send(ACE_Message_Block *message, ACE_Time_Value *timeout)
return( 0 );
}
-/* And here's the decompression side. We've written Xmit/Recv so that
+/* And here's the decompression side. We've written Xmit/Recv so that
we're guaranteed to get an entire block of compressed data. If
we'd used recv() in the Recv object then we might have gotten a
partial block and that may not decompress very nicely.
@@ -57,7 +57,7 @@ int Compressor::recv(ACE_Message_Block *message, ACE_Time_Value *timeout)
// Room for the decompressed data. In the real world you
// would probably want to send the original (uncompressed)
// data size in the message. You can predict the maximum
- // possible decompression size but it's cheap and easy just to
+ // possible decompression size but it's cheap and easy just to
// send that along. Look again at how I do exacly that
// between Xmit and Recv.
ACE_Message_Block * decompressed = new ACE_Message_Block( message->size() );
@@ -75,8 +75,8 @@ int Compressor::recv(ACE_Message_Block *message, ACE_Time_Value *timeout)
// Skip past the signature before going any further.
message->rd_ptr( 3 );
-
- // Perform a bogus decompression algorithm. This is where you
+
+ // Perform a bogus decompression algorithm. This is where you
// would feed to libz or your favorite decompressor. (It's
// costly but you could invoke popen() on gzip!)
ACE_OS::sprintf( decompressed->wr_ptr(), "%s", message->rd_ptr() );
diff --git a/docs/tutorials/015/Crypt.cpp b/docs/tutorials/015/Crypt.cpp
index 83cfd7ab73f..f599a46d34f 100644
--- a/docs/tutorials/015/Crypt.cpp
+++ b/docs/tutorials/015/Crypt.cpp
@@ -40,7 +40,7 @@ int Crypt::send(ACE_Message_Block *message, ACE_Time_Value *timeout)
return( 0 );
}
-/* The upstream movement requires that we decrypt what the peer has
+/* The upstream movement requires that we decrypt what the peer has
given us.
*/
int Crypt::recv(ACE_Message_Block *message, ACE_Time_Value *timeout)
@@ -62,7 +62,7 @@ int Crypt::recv(ACE_Message_Block *message, ACE_Time_Value *timeout)
// Don't forget to skip past the signature before decrypting
// or things will be quite exciting!
message->rd_ptr( 3 );
-
+
// Perform a bogus decryption algorithm
ACE_OS::sprintf( decrypted->wr_ptr(), "%s", message->rd_ptr() );
decrypted->wr_ptr( strlen(decrypted->wr_ptr())+1 );
diff --git a/docs/tutorials/015/Handler.cpp b/docs/tutorials/015/Handler.cpp
index 0cfb3242c3d..ab8e006f7c4 100644
--- a/docs/tutorials/015/Handler.cpp
+++ b/docs/tutorials/015/Handler.cpp
@@ -5,7 +5,7 @@
#include "Protocol_Task.h"
/* The Protocol_Stream gives us the option to insert a Protocol_Task
- to process data received by the stream. We'll get into the details
+ to process data received by the stream. We'll get into the details
more when we talk about the stream in detail. For now it's enough
to know that Handler_Task::recv() will be invoked by the stream
after data from the client has been received and processed (eg --
@@ -25,7 +25,7 @@ public:
protected:
// recv() is invoked after received data has been fully
- // processed by the protocol rules. Data processing typically
+ // processed by the protocol rules. Data processing typically
// done in handle_input() can then be done here.
int recv(ACE_Message_Block * message,
ACE_Time_Value *timeout = 0);
@@ -74,8 +74,8 @@ int Handler::open (void *)
{
ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) Cannot open the protocol stream.\n"), -1);
}
-
- // Now that we know the client is valid and that the stream is
+
+ // Now that we know the client is valid and that the stream is
// ready for business we can register with the gloabl reactor
// instance. Here again is an opportunity for improvement if
// we expect to have mulitple Server object instances.
@@ -113,8 +113,8 @@ int Handler::handle_close(ACE_HANDLE, ACE_Reactor_Mask _mask)
return 0;
}
-/* Unlike a "traditional" handle_input() ours is very simple. Because
- of the use of the protocol stream, we delegate the read function to
+/* Unlike a "traditional" handle_input() ours is very simple. Because
+ of the use of the protocol stream, we delegate the read function to
the stream's get() and rely on our Handler_Task to do the real work.
*/
int Handler::handle_input (ACE_HANDLE)
@@ -127,7 +127,7 @@ int Handler::handle_input (ACE_HANDLE)
{
ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) Cannot get data from protocol stream\n"), -1);
}
-
+
return 0;
}
diff --git a/docs/tutorials/015/Protocol_Stream.cpp b/docs/tutorials/015/Protocol_Stream.cpp
index ed9b866a1bd..a3d48d37e41 100644
--- a/docs/tutorials/015/Protocol_Stream.cpp
+++ b/docs/tutorials/015/Protocol_Stream.cpp
@@ -23,7 +23,7 @@ typedef ACE_Thru_Task<ACE_MT_SYNCH> Thru_Task;
/* An ACE_Stream is a collection of ACE_Modules. You can think of it
as a doubly-linked list if you like. Each Module contains two
- ACE_Task derivatives. One of these tasks is used when sending data
+ ACE_Task derivatives. One of these tasks is used when sending data
"upstream", the other is used for "downstream" operation. In some
cases, you'll only need to move data in one direction. To provide
a placeholder for the other direction, ACE_Thru_Task can be used.
@@ -33,7 +33,7 @@ typedef ACE_Thru_Task<ACE_MT_SYNCH> Thru_Task;
/* Do-nothing constructor and destructor
*/
-
+
Protocol_Stream::Protocol_Stream (void)
{
}
@@ -47,7 +47,7 @@ Protocol_Stream::~Protocol_Stream (void)
at the tail (eg -- most downstream) end of things when you're
done.
*/
-int
+int
Protocol_Stream::open (ACE_SOCK_Stream &peer,
Protocol_Task *reader)
{
@@ -99,7 +99,7 @@ Protocol_Stream::open (ACE_SOCK_Stream &peer,
/* Add the necessary protocol objects to the stream. The way we're
pushing things on we will encrypt the data before compressing it.
*/
-int
+int
Protocol_Stream::open (void)
{
#if defined (ENABLE_COMPRESSION)
@@ -111,7 +111,7 @@ Protocol_Stream::open (void)
"stream().push(comprssor)"),
-1);
#endif /* ENABLE_COMPRESSION */
-
+
#if defined (ENABLE_ENCRYPTION)
if (stream ().push (new Module ("crypt",
new Crypt (),
@@ -125,14 +125,14 @@ Protocol_Stream::open (void)
}
// Closing the Protocol_Stream is as simple as closing the ACE_Stream.
-int
+int
Protocol_Stream::close (void)
{
return stream ().close ();
}
// Simply pass the data directly to the ACE_Stream.
-int
+int
Protocol_Stream::put (ACE_Message_Block *&message,
ACE_Time_Value *timeout)
{
@@ -144,7 +144,7 @@ Protocol_Stream::put (ACE_Message_Block *&message,
upstream. Servers will typically use this method in a
handle_input() method to tell the stream to get a client's request. */
-int
+int
Protocol_Stream::get(void)
{
// If there is no Recv module, we're in big trouble!
@@ -180,7 +180,7 @@ Protocol_Stream::get(void)
most often used by client applications. Servers will generaly
insert a reader that will prevent the data from getting all the way
upstream to the head. */
-int
+int
Protocol_Stream::get (ACE_Message_Block *&response,
ACE_Time_Value *timeout )
{
@@ -189,7 +189,7 @@ Protocol_Stream::get (ACE_Message_Block *&response,
ACE_ERROR_RETURN ((LM_ERROR,
"(%P|%t) Cannot get data into the stream.\n"),
-1);
-
+
return stream ().head ()->reader ()->getq (response,
timeout);
}
diff --git a/docs/tutorials/015/Protocol_Task.cpp b/docs/tutorials/015/Protocol_Task.cpp
index b1eb82a43ad..a1bdc51f63b 100644
--- a/docs/tutorials/015/Protocol_Task.cpp
+++ b/docs/tutorials/015/Protocol_Task.cpp
@@ -14,7 +14,7 @@ Protocol_Task::~Protocol_Task(void)
;
}
-int Protocol_Task::open(void *arg)
+int Protocol_Task::open(void *arg)
{
ACE_UNUSED_ARG(arg);
@@ -41,7 +41,7 @@ int Protocol_Task::svc(void)
}
/* There's nothing really magic about process(). We just decide if
- we're moving data upstream or downstream and invoke the appropriate
+ we're moving data upstream or downstream and invoke the appropriate
virtual function to handle it.
*/
int Protocol_Task::process(ACE_Message_Block * message, ACE_Time_Value *timeout)
@@ -50,16 +50,16 @@ int Protocol_Task::process(ACE_Message_Block * message, ACE_Time_Value *timeout)
{
return this->send(message,timeout);
}
-
+
return this->recv(message,timeout);
}
/* We must insist that derivatives provide a meaningful overload for
- these methods. It's fairly common for ACE object methods to return
+ these methods. It's fairly common for ACE object methods to return
an error when an overload is expected but the method cannot be
safely made pure virtual.
*/
-
+
int Protocol_Task::send(ACE_Message_Block *message,
ACE_Time_Value *timeout)
{
diff --git a/docs/tutorials/015/Protocol_Task.h b/docs/tutorials/015/Protocol_Task.h
index f886001678f..2ea7d339eb8 100644
--- a/docs/tutorials/015/Protocol_Task.h
+++ b/docs/tutorials/015/Protocol_Task.h
@@ -35,7 +35,7 @@ public:
virtual int put (ACE_Message_Block *message,
ACE_Time_Value *timeout);
- // We're obligated to provide this signature even though we won't be
+ // We're obligated to provide this signature even though we won't be
// allowing this object to be activated.
virtual int svc (void);
diff --git a/docs/tutorials/015/Recv.cpp b/docs/tutorials/015/Recv.cpp
index 121e50c213b..0cf739e7d25 100644
--- a/docs/tutorials/015/Recv.cpp
+++ b/docs/tutorials/015/Recv.cpp
@@ -27,7 +27,7 @@ Recv::~Recv(void)
/* By putting the tickler to ourselves we cause things to happen in
the baseclass that will invoke recv(). If we know we're single
- threaded we could directly call recv() and be done with it but then
+ threaded we could directly call recv() and be done with it but then
we'd have to do something else if we're multi-threaded. Just let
the baseclass worry about those things!
*/
@@ -88,6 +88,6 @@ int Recv::recv(ACE_Message_Block * message, ACE_Time_Value *timeout)
// Something bad happend on the recv_n(). Set an error flag
// and return error.
error_ = 1;
-
+
return( -1 );
}
diff --git a/docs/tutorials/015/Server_i.cpp b/docs/tutorials/015/Server_i.cpp
index e71803b3d26..5de37d07e85 100644
--- a/docs/tutorials/015/Server_i.cpp
+++ b/docs/tutorials/015/Server_i.cpp
@@ -8,7 +8,7 @@
*/
sig_atomic_t Server::finished_ = 0;
-/* The simple constructor and destructor don't do anything but give us
+/* The simple constructor and destructor don't do anything but give us
a place to expand in the future if we want.
*/
Server::Server(void)
@@ -55,7 +55,7 @@ int Server::run(void)
ACE_Reactor::instance()->handle_events (&timeout);
}
- // Close the acceptor when we're done. This may be handled by
+ // Close the acceptor when we're done. This may be handled by
// the framework but it's good practice to be explicit about things.
acceptor_.close();
diff --git a/docs/tutorials/015/Xmit.cpp b/docs/tutorials/015/Xmit.cpp
index 9450fc00cf0..28be01b1d25 100644
--- a/docs/tutorials/015/Xmit.cpp
+++ b/docs/tutorials/015/Xmit.cpp
@@ -46,7 +46,7 @@ int Xmit::close(u_long flags)
int Xmit::send(ACE_Message_Block *message, ACE_Time_Value *timeout)
{
int rval;
-
+
ACE_DEBUG ((LM_INFO, "(%P|%t) Xmit::send() sending (%s)(%d)\n", message->rd_ptr(), message->length() ));
/* Since we're going to be sending data that may have been
@@ -54,7 +54,7 @@ int Xmit::send(ACE_Message_Block *message, ACE_Time_Value *timeout)
receiver to get an entire "block" instead of having a
partial read.
- For that reason, we'll send the length of the message block
+ For that reason, we'll send the length of the message block
(in clear-text) to the peer so that it can then recv_n()
the entire block contents in one read operation.
*/
@@ -71,7 +71,7 @@ int Xmit::send(ACE_Message_Block *message, ACE_Time_Value *timeout)
}
/* Now we send the actual data. If you're worried about
- network efficiency then you may choose to create one buffer
+ network efficiency then you may choose to create one buffer
containing msize and the message data and send it all at
once.
*/
diff --git a/docs/tutorials/015/client.cpp b/docs/tutorials/015/client.cpp
index a573b4f3902..93041dcdfdd 100644
--- a/docs/tutorials/015/client.cpp
+++ b/docs/tutorials/015/client.cpp
@@ -1,7 +1,7 @@
// $Id$
-/* The Client object will implement the nasty details of connecting to
+/* The Client object will implement the nasty details of connecting to
communicating with the server
*/
#include "Client_i.h"
@@ -29,19 +29,19 @@ int main(int argc, char *argv[])
ACE_Message_Block * message = new ACE_Message_Block( 128 );
// Construct a silly message to send to the server.
- // Notice that we're careful to add one to the strlen() so
+ // Notice that we're careful to add one to the strlen() so
// that we also send the end-of-string NULL character.
ACE_OS::sprintf (message->wr_ptr (), "This is message %d.", i);
message->wr_ptr (strlen (message->rd_ptr ())+1);
- // client will take ownership of the message block so that
+ // client will take ownership of the message block so that
// we don't have to remember to release(). We *do* have
// to remember not to use it after put() since it may be
// released almost immediately.
client.put( message );
ACE_Message_Block * response;
-
+
// get() takes an ACE_Message_Block pointer reference. We then
// assume ownership of it and must release() when we're done.
if( client.get( response ) == -1 )
@@ -50,14 +50,14 @@ int main(int argc, char *argv[])
break;
}
- ACE_DEBUG ((LM_INFO, "(%P|%t) The server's response: (%s)\n",
+ ACE_DEBUG ((LM_INFO, "(%P|%t) The server's response: (%s)\n",
response->rd_ptr()));
// Now that we're through with the response we have to
// release() it to avoid memory leaks.
response->release();
}
-
+
ACE_DEBUG ((LM_INFO, "(%P|%t) Shutting down the stream\n" ));
// Before we exit, it's a good idea to properly close() the connection.
@@ -65,6 +65,6 @@ int main(int argc, char *argv[])
{
ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "Client::close()"), -1);
}
-
+
return(0);
}
diff --git a/docs/tutorials/015/combine.shar b/docs/tutorials/015/combine.shar
index 68a509ce351..abd131ab031 100644
--- a/docs/tutorials/015/combine.shar
+++ b/docs/tutorials/015/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-02-14 13:38 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/015'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/015'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -83,7 +83,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh31334; then
+if mkdir _sh05091; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -1059,5 +1059,5 @@ SHAR_EOF
$echo 'page09.pst:' 'original size' '617,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh31334
+rm -fr _sh05091
exit 0
diff --git a/docs/tutorials/015/page01.html b/docs/tutorials/015/page01.html
index 098d031d3ad..67cc0882ce0 100644
--- a/docs/tutorials/015/page01.html
+++ b/docs/tutorials/015/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -26,10 +27,10 @@ In a more robust system, one might want to process the data before
compression, applying checksums or any number of other actions.
<P>
In this tutorial a Protocol_Stream object is created to encrypt and
- compress* data being sent between peers. Both client and server
+ compress* data being sent between peers. Both client and server
applications are presented as well. I present the application
level code first and then go into the details of the protocol stream
-and it's helper objects. If the stream stuff in the application logic
+and it's helper objects. If the stream stuff in the application logic
is confusing then just read on by and come back to it after the later
discussions.
<P>
@@ -58,7 +59,7 @@ conformance details. The underlying SOCK_Stream is used to set up the
connection using the ACE_SOCK_Connector class. Once the connector
completes its job, the SOCK_Stream pointer is passed on to the
Protocol Stream which now takes over. The Client has put() and get()
-methods to send and receive data from the server.
+methods to send and receive data from the server.
<P>
The server is implemented using the ACE_Acceptor to listen at the port
for connections and a reactor for delegating events to the appropriate
diff --git a/docs/tutorials/015/page02.html b/docs/tutorials/015/page02.html
index 4431fc4cf78..e27067b6ae1 100644
--- a/docs/tutorials/015/page02.html
+++ b/docs/tutorials/015/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -21,7 +22,7 @@ We'll take a look first at the client application. As usual, our goal
<font color=red>// $Id$</font>
-<font color=red>/* The Client object will implement the nasty details of connecting to
+<font color=red>/* The Client object will implement the nasty details of connecting to
communicating with the server
*/</font>
<font color=blue>#include</font> "<font color=green>Client_i.h</font>"
@@ -61,7 +62,7 @@ int main(int argc, char *argv[])
client.put( message );
ACE_Message_Block * response;
-
+
<font color=red>// get() takes an ACE_Message_Block pointer reference. We then</font>
<font color=red>// assume ownership of it and must release() when we're done.</font>
if( client.get( response ) == -1 )
@@ -70,14 +71,14 @@ int main(int argc, char *argv[])
break;
}
- ACE_DEBUG ((LM_INFO, "<font color=green>(%P|%t) The server's response: (%s)\n</font>",
+ ACE_DEBUG ((LM_INFO, "<font color=green>(%P|%t) The server's response: (%s)\n</font>",
response->rd_ptr()));
<font color=red>// Now that we're through with the response we have to</font>
<font color=red>// release() it to avoid memory leaks.</font>
response->release();
}
-
+
ACE_DEBUG ((LM_INFO, "<font color=green>(%P|%t) Shutting down the stream\n</font>" ));
<font color=red>// Before we exit, it's a good idea to properly close() the connection.</font>
@@ -85,7 +86,7 @@ int main(int argc, char *argv[])
{
ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green><font color=#008888>Client::close</font>()</font>"), -1);
}
-
+
return(0);
}
</PRE>
diff --git a/docs/tutorials/015/page03.html b/docs/tutorials/015/page03.html
index ca92ec3cbcd..fb99108a742 100644
--- a/docs/tutorials/015/page03.html
+++ b/docs/tutorials/015/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/015/page04.html b/docs/tutorials/015/page04.html
index b538dc65bc8..61a2a0692b7 100644
--- a/docs/tutorials/015/page04.html
+++ b/docs/tutorials/015/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/015/page05.html b/docs/tutorials/015/page05.html
index dbfe16e91d7..104911d718b 100644
--- a/docs/tutorials/015/page05.html
+++ b/docs/tutorials/015/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -12,10 +13,10 @@
<P>
<HR WIDTH="100%">
-Like the client, we want to keep the main() part of our server code as
+Like the client, we want to keep the main() part of our server code as
simple as possible. This is done by putting most of the work
into the Handler object that will deal with client connections.
-From the looks of the code below, I think we've been successful in our
+From the looks of the code below, I think we've been successful in our
simplification.
<HR>
diff --git a/docs/tutorials/015/page06.html b/docs/tutorials/015/page06.html
index 8ffa8bdb12e..0567c90e187 100644
--- a/docs/tutorials/015/page06.html
+++ b/docs/tutorials/015/page06.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -12,13 +13,13 @@
<P>
<HR WIDTH="100%">
-The Server object exists in order simplify the
+The Server object exists in order simplify the
main() application level. To that end, it hides the details of
creating an acceptor and managing the reactor.
<P>
-The static close() method available for a signal handler as you saw on
+The static close() method available for a signal handler as you saw on
the previous page. Of course the assumption here is that there would
-only be one Server instance but since you can't provide a TCP/IP port,
+only be one Server instance but since you can't provide a TCP/IP port,
that's probably a valid assumption!
<HR>
<PRE>
diff --git a/docs/tutorials/015/page07.html b/docs/tutorials/015/page07.html
index 06633974eb6..e2aeb527c2d 100644
--- a/docs/tutorials/015/page07.html
+++ b/docs/tutorials/015/page07.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -30,7 +31,7 @@ application when you take this sort of approach.
*/</font>
sig_atomic_t <font color=#008888>Server::finished_</font> = 0;
-<font color=red>/* The simple constructor and destructor don't do anything but give us
+<font color=red>/* The simple constructor and destructor don't do anything but give us
a place to expand in the future if we want.
*/</font>
<font color=#008888>Server::Server</font>(void)
diff --git a/docs/tutorials/015/page08.html b/docs/tutorials/015/page08.html
index 127bab8f00c..01cec6cfa33 100644
--- a/docs/tutorials/015/page08.html
+++ b/docs/tutorials/015/page08.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -13,7 +14,7 @@
<P>
<HR WIDTH="100%">
The Handler object is our event handler. You can use either
-ACE_Event_Handler or ACE_Svc_Handler<> for the baseclass. I generally
+ACE_Event_Handler or ACE_Svc_Handler<> for the baseclass. I generally
prefer the latter since it takes care of some housekeeping that I
would otherwise be responsible for.
<P>
diff --git a/docs/tutorials/015/page09.html b/docs/tutorials/015/page09.html
index b8156b13271..e85bb37813d 100644
--- a/docs/tutorials/015/page09.html
+++ b/docs/tutorials/015/page09.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -17,8 +18,8 @@ responsible for getting data from the peer() and doing something with
it. In this case, we have a Protocol_Stream to deal with. We'll use
the stream for the actual I/O but we are ultimately responsible for
processing the data from the peer. To do that, we've created a
-Handler_Task that fits within the Protocol_Stream framework to process
-data that has been received. Handler::handle_input() will tell the stream that
+Handler_Task that fits within the Protocol_Stream framework to process
+data that has been received. Handler::handle_input() will tell the stream that
it's time to read data and that data will eventually show up at
Handler_Task::recv() where we'll process it as required by our
application logic.
@@ -31,7 +32,7 @@ application logic.
<font color=blue>#include</font> "<font color=green>Protocol_Task.h</font>"
<font color=red>/* The Protocol_Stream gives us the option to insert a Protocol_Task
- to process data received by the stream. We'll get into the details
+ to process data received by the stream. We'll get into the details
more when we talk about the stream in detail. For now it's enough
to know that <font color=#008888>Handler_Task::recv</font>() will be invoked by the stream
after data from the client has been received and processed (eg --
@@ -100,7 +101,7 @@ int <font color=#008888>Handler::open</font> (void *)
{
ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>(%P|%t) Cannot open the protocol stream.\n</font>"), -1);
}
-
+
<font color=red>// Now that we know the client is valid and that the stream is </font>
<font color=red>// ready for business we can register with the gloabl reactor</font>
<font color=red>// instance. Here again is an opportunity for improvement if</font>
@@ -139,8 +140,8 @@ int <font color=#008888>Handler::handle_close</font>(ACE_HANDLE, ACE_Reactor_Mas
return 0;
}
-<font color=red>/* Unlike a "<font color=green>traditional</font>" handle_input() ours is very simple. Because
- of the use of the protocol stream, we delegate the read function to
+<font color=red>/* Unlike a "<font color=green>traditional</font>" handle_input() ours is very simple. Because
+ of the use of the protocol stream, we delegate the read function to
the stream's get() and rely on our Handler_Task to do the real work.
*/</font>
int <font color=#008888>Handler::handle_input</font> (ACE_HANDLE)
@@ -153,7 +154,7 @@ int <font color=#008888>Handler::handle_input</font> (ACE_HANDLE)
{
ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>(%P|%t) Cannot get data from protocol stream\n</font>"), -1);
}
-
+
return 0;
}
@@ -208,7 +209,7 @@ int <font color=#008888>Handler_Task::recv</font>(ACE_Message_Block * message,
<P>
That's it for the server-specific code. I think I've been fairly
successful in keeping it simple and to the point. There are a couple
-of places where the as-yet-undescribed Protocol_Stream pops up and may
+of places where the as-yet-undescribed Protocol_Stream pops up and may
cause confusion. We're going to discuss that mystery now but before
we do here's the list of server files if you want to review:
diff --git a/docs/tutorials/015/page10.html b/docs/tutorials/015/page10.html
index 3d012c0e970..762d3fa7489 100644
--- a/docs/tutorials/015/page10.html
+++ b/docs/tutorials/015/page10.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -13,11 +14,11 @@
<P>
<HR WIDTH="100%">
And so finally we come to the Protocol_Stream. That, after all, is
-the focus of the entire tutorial but it took us half of the day to get
+the focus of the entire tutorial but it took us half of the day to get
here!
<P>
The Protocol_Stream uses an ACE_Stream to move an ACE_Message_Block
-through a series of tasks. Each task in the stream is responsible for
+through a series of tasks. Each task in the stream is responsible for
performing some operation on the data in the message block. That is
the nature of a protocol stream (or "stack" if you prefer). In this
stream, the data is compressed and encrypted* on its way between
diff --git a/docs/tutorials/015/page11.html b/docs/tutorials/015/page11.html
index 31eb52bac2d..eefb2706a1d 100644
--- a/docs/tutorials/015/page11.html
+++ b/docs/tutorials/015/page11.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -44,7 +45,7 @@ typedef ACE_Thru_Task&lt;ACE_MT_SYNCH> Thru_Task;
<font color=red>/* An ACE_Stream is a collection of ACE_Modules. You can think of it
as a doubly-linked list if you like. Each Module contains two
- ACE_Task derivatives. One of these tasks is used when sending data
+ ACE_Task derivatives. One of these tasks is used when sending data
"<font color=green>upstream</font>", the other is used for "<font color=green>downstream</font>" operation. In some
cases, you'll only need to move data in one direction. To provide
a placeholder for the other direction, ACE_Thru_Task can be used.
@@ -54,7 +55,7 @@ typedef ACE_Thru_Task&lt;ACE_MT_SYNCH> Thru_Task;
<font color=red>/* Do-nothing constructor and destructor
*/</font>
-
+
<font color=#008888>Protocol_Stream::Protocol_Stream</font> (void)
{
}
@@ -68,7 +69,7 @@ typedef ACE_Thru_Task&lt;ACE_MT_SYNCH> Thru_Task;
at the tail (eg -- most downstream) end of things when you're
done.
*/</font>
-int
+int
<font color=#008888>Protocol_Stream::open</font> (ACE_SOCK_Stream &peer,
Protocol_Task *reader)
{
@@ -120,7 +121,7 @@ int
<font color=red>/* Add the necessary protocol objects to the stream. The way we're
pushing things on we will encrypt the data before compressing it.
*/</font>
-int
+int
<font color=#008888>Protocol_Stream::open</font> (void)
{
<font color=blue>#if defined</font> (<font color=purple>ENABLE_COMPRESSION</font>)
@@ -132,7 +133,7 @@ int
"<font color=green>stream().push(comprssor)</font>"),
-1);
<font color=blue>#endif</font> <font color=red>/* ENABLE_COMPRESSION */</font>
-
+
<font color=blue>#if defined</font> (<font color=purple>ENABLE_ENCRYPTION</font>)
if (stream ().push (new Module ("<font color=green>crypt</font>",
new Crypt (),
@@ -146,14 +147,14 @@ int
}
<font color=red>// Closing the Protocol_Stream is as simple as closing the ACE_Stream.</font>
-int
+int
<font color=#008888>Protocol_Stream::close</font> (void)
{
return stream ().close ();
}
<font color=red>// Simply pass the data directly to the ACE_Stream.</font>
-int
+int
<font color=#008888>Protocol_Stream::put</font> (ACE_Message_Block *&message,
ACE_Time_Value *timeout)
{
@@ -165,7 +166,7 @@ int
upstream. Servers will typically use this method in a
handle_input() method to tell the stream to get a client's request. */</font>
-int
+int
<font color=#008888>Protocol_Stream::get</font>(void)
{
<font color=red>// If there is no Recv module, we're in big trouble!</font>
@@ -201,7 +202,7 @@ int
most often used by client applications. Servers will generaly
insert a reader that will prevent the data from getting all the way
upstream to the head. */</font>
-int
+int
<font color=#008888>Protocol_Stream::get</font> (ACE_Message_Block *&response,
ACE_Time_Value *timeout )
{
@@ -210,7 +211,7 @@ int
ACE_ERROR_RETURN ((LM_ERROR,
"<font color=green>(%P|%t) Cannot get data into the stream.\n</font>"),
-1);
-
+
return stream ().head ()->reader ()->getq (response,
timeout);
}
diff --git a/docs/tutorials/015/page12.html b/docs/tutorials/015/page12.html
index 93358494a85..3847fa296b3 100644
--- a/docs/tutorials/015/page12.html
+++ b/docs/tutorials/015/page12.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/015/page13.html b/docs/tutorials/015/page13.html
index a6371dcc60a..786be8904eb 100644
--- a/docs/tutorials/015/page13.html
+++ b/docs/tutorials/015/page13.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -15,7 +16,7 @@
The Protocol_Task implementation takes care of the open(), close(),
put() and svc() methods so that derivatives can concentrate on the
send() and recv() methods. After a while you find that most
-ACE_Task<> derivatives look very similar in the four basic methods and
+ACE_Task<> derivatives look very similar in the four basic methods and
only need one or two additional to do any real work.
<HR>
<PRE>
@@ -35,7 +36,7 @@ only need one or two additional to do any real work.
;
}
-int <font color=#008888>Protocol_Task::open</font>(void *arg)
+int <font color=#008888>Protocol_Task::open</font>(void *arg)
{
ACE_UNUSED_ARG(arg);
@@ -62,7 +63,7 @@ int <font color=#008888>Protocol_Task::svc</font>(void)
}
<font color=red>/* There's nothing really magic about process(). We just decide if
- we're moving data upstream or downstream and invoke the appropriate
+ we're moving data upstream or downstream and invoke the appropriate
virtual function to handle it.
*/</font>
int <font color=#008888>Protocol_Task::process</font>(ACE_Message_Block * message, ACE_Time_Value *timeout)
@@ -71,16 +72,16 @@ int <font color=#008888>Protocol_Task::process</font>(ACE_Message_Block * messag
{
return this->send(message,timeout);
}
-
+
return this->recv(message,timeout);
}
<font color=red>/* We must insist that derivatives provide a meaningful overload for
- these methods. It's fairly common for ACE object methods to return
+ these methods. It's fairly common for ACE object methods to return
an error when an overload is expected but the method cannot be
safely made pure virtual.
*/</font>
-
+
int <font color=#008888>Protocol_Task::send</font>(ACE_Message_Block *message,
ACE_Time_Value *timeout)
{
diff --git a/docs/tutorials/015/page14.html b/docs/tutorials/015/page14.html
index ea27af4db50..fcd9e49e21a 100644
--- a/docs/tutorials/015/page14.html
+++ b/docs/tutorials/015/page14.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -19,7 +20,7 @@ and doesn't concern itself with anyone else' details.
<P>
The only thing you might want to do is combine it with Recv. Why?
As you'll realize in a page or two, the Xmit and Recv objects must
-interact if you're going to ensure a safe transit. By having a single
+interact if you're going to ensure a safe transit. By having a single
object it's easier to coordinate and maintain the interaction.
<HR>
<PRE>
diff --git a/docs/tutorials/015/page15.html b/docs/tutorials/015/page15.html
index 66e4f1bf852..799947b0bed 100644
--- a/docs/tutorials/015/page15.html
+++ b/docs/tutorials/015/page15.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -17,7 +18,7 @@ combine it with the Recv task we simply lift the recv() method from
that object and drop it into this one.
<P>
Note that close() must decide if it's being called when the stream is
-shutdown or when it's svc() method exits. Since we tell the baseclass
+shutdown or when it's svc() method exits. Since we tell the baseclass
not to use any threads it's a safe bet that flags will always be
non-zero. Still, it's good practice to plan for the future by
checking the value.
@@ -77,7 +78,7 @@ int <font color=#008888>Xmit::close</font>(u_long flags)
int <font color=#008888>Xmit::send</font>(ACE_Message_Block *message, ACE_Time_Value *timeout)
{
int rval;
-
+
ACE_DEBUG ((LM_INFO, "<font color=green>(%P|%t) <font color=#008888>Xmit::send</font>() sending (%s)(%d)\n</font>", message->rd_ptr(), message->length() ));
<font color=red>/* Since we're going to be sending data that may have been
@@ -85,7 +86,7 @@ int <font color=#008888>Xmit::send</font>(ACE_Message_Block *message, ACE_Time_V
receiver to get an entire "<font color=green>block</font>" instead of having a
partial read.
- For that reason, we'll send the length of the message block
+ For that reason, we'll send the length of the message block
(in clear-text) to the peer so that it can then recv_n()
the entire block contents in one read operation.
*/</font>
@@ -102,7 +103,7 @@ int <font color=#008888>Xmit::send</font>(ACE_Message_Block *message, ACE_Time_V
}
<font color=red>/* Now we send the actual data. If you're worried about
- network efficiency then you may choose to create one buffer
+ network efficiency then you may choose to create one buffer
containing msize and the message data and send it all at
once.
*/</font>
diff --git a/docs/tutorials/015/page16.html b/docs/tutorials/015/page16.html
index e372f6d68bf..d2f3e3c78d2 100644
--- a/docs/tutorials/015/page16.html
+++ b/docs/tutorials/015/page16.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -21,7 +22,7 @@ However, there doesn't seem to be a way to put data in such that it
will travel upstream. To get around that, I've added a get() method
to Recv that will trigger a read on the socket. Recv will then put
the data to the next upstream module and we're on our way. As noted
-earlier, that data will eventually show up either in the <i>reader</i>
+earlier, that data will eventually show up either in the <i>reader</i>
(if installed on the stream open()) or the stream head reader task's
message queue.
<HR>
diff --git a/docs/tutorials/015/page17.html b/docs/tutorials/015/page17.html
index 3a07c2eca89..8041733a94f 100644
--- a/docs/tutorials/015/page17.html
+++ b/docs/tutorials/015/page17.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -47,7 +48,7 @@ basic stuff.
<font color=red>/* By putting the tickler to ourselves we cause things to happen in
the baseclass that will invoke recv(). If we know we're single
- threaded we could directly call recv() and be done with it but then
+ threaded we could directly call recv() and be done with it but then
we'd have to do something else if we're multi-threaded. Just let
the baseclass worry about those things!
*/</font>
@@ -108,7 +109,7 @@ int <font color=#008888>Recv::recv</font>(ACE_Message_Block * message, ACE_Time_
<font color=red>// Something bad happend on the recv_n(). Set an error flag</font>
<font color=red>// and return error.</font>
error_ = 1;
-
+
return( -1 );
}
</PRE>
diff --git a/docs/tutorials/015/page18.html b/docs/tutorials/015/page18.html
index d17427ffeeb..4fa684e7b6b 100644
--- a/docs/tutorials/015/page18.html
+++ b/docs/tutorials/015/page18.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/015/page19.html b/docs/tutorials/015/page19.html
index 2b62ec0bdb3..4c87c8c5e3d 100644
--- a/docs/tutorials/015/page19.html
+++ b/docs/tutorials/015/page19.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -65,7 +66,7 @@ int <font color=#008888>Compressor::send</font>(ACE_Message_Block *message, ACE_
return( 0 );
}
-<font color=red>/* And here's the decompression side. We've written Xmit/Recv so that
+<font color=red>/* And here's the decompression side. We've written Xmit/Recv so that
we're guaranteed to get an entire block of compressed data. If
we'd used recv() in the Recv object then we might have gotten a
partial block and that may not decompress very nicely.
@@ -95,7 +96,7 @@ int <font color=#008888>Compressor::recv</font>(ACE_Message_Block *message, ACE_
<font color=red>// Skip past the signature before going any further.</font>
message->rd_ptr( 3 );
-
+
<font color=red>// Perform a bogus decompression algorithm. This is where you </font>
<font color=red>// would feed to libz or your favorite decompressor. (It's</font>
<font color=red>// costly but you could invoke popen() on gzip!)</font>
diff --git a/docs/tutorials/015/page20.html b/docs/tutorials/015/page20.html
index 5a073600d10..3f604e11bfa 100644
--- a/docs/tutorials/015/page20.html
+++ b/docs/tutorials/015/page20.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -17,7 +18,7 @@ don't have a snowball's chance to code up encryption. I'd be better
off piping the data through the standard Unix crypt command.
<P>
So, while I was lazy with Compress, I'm realistic with Crypt. I'll
-show you the hooks and entry points and let someone else contribute an
+show you the hooks and entry points and let someone else contribute an
encryptor.
<HR>
<PRE>
diff --git a/docs/tutorials/015/page21.html b/docs/tutorials/015/page21.html
index a1aced14565..c5b2f59105a 100644
--- a/docs/tutorials/015/page21.html
+++ b/docs/tutorials/015/page21.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -59,7 +60,7 @@ int <font color=#008888>Crypt::send</font>(ACE_Message_Block *message, ACE_Time_
return( 0 );
}
-<font color=red>/* The upstream movement requires that we decrypt what the peer has
+<font color=red>/* The upstream movement requires that we decrypt what the peer has
given us.
*/</font>
int <font color=#008888>Crypt::recv</font>(ACE_Message_Block *message, ACE_Time_Value *timeout)
@@ -81,7 +82,7 @@ int <font color=#008888>Crypt::recv</font>(ACE_Message_Block *message, ACE_Time_
<font color=red>// Don't forget to skip past the signature before decrypting</font>
<font color=red>// or things will be quite exciting!</font>
message->rd_ptr( 3 );
-
+
<font color=red>// Perform a bogus decryption algorithm</font>
<font color=#008888>ACE_OS::sprintf</font>( decrypted->wr_ptr(), "<font color=green>%s</font>", message->rd_ptr() );
decrypted->wr_ptr( strlen(decrypted->wr_ptr())+1 );
diff --git a/docs/tutorials/015/page22.html b/docs/tutorials/015/page22.html
index 2c412e41b30..270e81f38e9 100644
--- a/docs/tutorials/015/page22.html
+++ b/docs/tutorials/015/page22.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -20,7 +21,7 @@ A quick review of what we've done:
<LI>Create a simple client application and Client object that uses a
Protocol Stream without really knowing how they work. The app (and
-object) rely on the public interface of the Protocol Stream to get the
+object) rely on the public interface of the Protocol Stream to get the
job done. At this level the protocol details are irrelevant.
<P>
<LI>Next, we create a simple server application and Server object
@@ -30,13 +31,13 @@ will ultimately process the data from the client.
<P>
<LI>We then go into the details of the Protocol_Stream implementation
and it's Protocol_Task object that forms the basis for the stream
-tasks. Each object is kept as small and simple as possible to improve
+tasks. Each object is kept as small and simple as possible to improve
reusability and future maintenance.
<P>
<LI>Finally, the individual protocol objects are discused. Separate
objects for the peer interface were created as well as the bogus
-compressor and encryptor. The protocol can be extended or modified by
-creating new such objects and installing them in the Protocol_Stream's
+compressor and encryptor. The protocol can be extended or modified by
+creating new such objects and installing them in the Protocol_Stream's
open() method.
</UL>
diff --git a/docs/tutorials/015/server.cpp b/docs/tutorials/015/server.cpp
index 4867833c220..6841a6c9b04 100644
--- a/docs/tutorials/015/server.cpp
+++ b/docs/tutorials/015/server.cpp
@@ -24,7 +24,7 @@ int main (int, char **)
// To keep things simple, I'll create it on the stack.
ACE_Select_Reactor mySelectReactor;
- // Next, we need an ACE_Reactor that is the bridge between the
+ // Next, we need an ACE_Reactor that is the bridge between the
// code and the real reactor. It is given a pointer to the
// real reactor.
ACE_Reactor myReactor (&mySelectReactor);
diff --git a/docs/tutorials/016/Condition_i.cpp b/docs/tutorials/016/Condition_i.cpp
index d7facf62c80..20377f3c935 100644
--- a/docs/tutorials/016/Condition_i.cpp
+++ b/docs/tutorials/016/Condition_i.cpp
@@ -22,7 +22,7 @@ Condition::~Condition(void)
}
/* The cast operator is the easiest way to return a copy of the value
- to clients of the class. It also allows us to use a private method
+ to clients of the class. It also allows us to use a private method
for getting a reference to the value when we need to modify it.
*/
Condition::operator Condition::value_t (void)
@@ -34,12 +34,12 @@ Condition::operator Condition::value_t (void)
}
/* Traditional prefix increment operator.
- We place a guard around the operation so that we don't collide with
+ We place a guard around the operation so that we don't collide with
any other threads. After the modification, we broadcast() a
- condition change to any waiting threads. You can also use signal()
+ condition change to any waiting threads. You can also use signal()
but that will only tell one thread about the change. If that
thread, in turn, invokes signal() then all threads will eventually
- find out. I just thought it would be easier to use broadcast() and
+ find out. I just thought it would be easier to use broadcast() and
be done with it.
*/
Condition & Condition::operator++ (void)
diff --git a/docs/tutorials/016/Condition_i.h b/docs/tutorials/016/Condition_i.h
index 2cd7adb21ba..83f32489d20 100644
--- a/docs/tutorials/016/Condition_i.h
+++ b/docs/tutorials/016/Condition_i.h
@@ -21,7 +21,7 @@ public:
// From here on I'll use value_t instead of 'int' to make any
// future upgrades easier.
typedef int value_t;
-
+
// Initialize the condition variable
Condition (value_t value = 0);
~Condition (void);
@@ -106,7 +106,7 @@ public:
Just be sure that _compare(value_) will return non-zero when you
consider the condition to be met. */
int operator== (Compare & compare);
-
+
private:
// Prevent copy construction and assignment.
Condition (const Condition &condition);
diff --git a/docs/tutorials/016/combine.shar b/docs/tutorials/016/combine.shar
index 9c5c9d8c6c0..be67e809b99 100644
--- a/docs/tutorials/016/combine.shar
+++ b/docs/tutorials/016/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-02-14 14:20 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/016'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/016'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -64,7 +64,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh31855; then
+if mkdir _sh05153; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -381,5 +381,5 @@ SHAR_EOF
$echo 'page05.pre:' 'original size' '606,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh31855
+rm -fr _sh05153
exit 0
diff --git a/docs/tutorials/016/condition.cpp b/docs/tutorials/016/condition.cpp
index d489ee6a355..39690ca689b 100644
--- a/docs/tutorials/016/condition.cpp
+++ b/docs/tutorials/016/condition.cpp
@@ -17,7 +17,7 @@ public:
// Open the Task with enough threads to make a useful test.
int open(void);
-
+
protected:
// Each thread will do work on the Condition.
int svc(void);
@@ -56,13 +56,16 @@ Test::~Test(void)
int Test::open(void)
{
seed_ = ACE_OS::gettimeofday().usec();
-
+
ACE_OS::srand( seed_ );
-
+
+ // This is not a place where we want to use THR_DETACHED.
+ // We're going to be waiting for our threads and if we detach
+ // them, we'll loose track and horrible things will happen.
return this->activate(THR_NEW_LWP, max_threads_);
}
-/* Each thread will modify the condition variable in some way and then
+/* Each thread will modify the condition variable in some way and then
wait for the condition to be satisfied. The derived classes
overload modify() and test() to implement a specific test of the
Condition class.
@@ -73,19 +76,19 @@ int Test::svc(void)
// cause test() in other threads to delay a bit.
int stime = ACE_OS::rand_r( seed_ ) % 5;
ACE_OS::sleep(abs(stime)+2);
-
+
ACE_DEBUG ((LM_INFO, "(%P|%t|%T)\tTest::svc() befor modify, condition_ is: %d\n", (int)condition_ ));
// Change the condition variable's value
modify();
-
+
ACE_DEBUG ((LM_INFO, "(%P|%t|%T)\tTest::svc() after modify, condition_ is: %d\n", (int)condition_ ));
// Test for the condition we want
test();
-
+
ACE_DEBUG ((LM_INFO, "(%P|%t|%T)\tTest::svc() leaving.\n" ));
-
+
return(0);
}
@@ -124,7 +127,7 @@ public:
class Test_ge : public Test
{
public:
- // For max_threads_ == 5, we will start the condition variable at
+ // For max_threads_ == 5, we will start the condition variable at
// the value 9. When the "last" thread decrements it, the value
// will be 4 which satisfies the condition.
Test_ge( int _max_threads )
@@ -215,7 +218,7 @@ public:
}
};
- // Create the CompareFunction and wait for the condition variable
+ // Create the CompareFunction and wait for the condition variable
// to reach the state we want.
void test(void)
{
@@ -224,7 +227,7 @@ public:
}
};
-/* In main() we just instantiate each of the four test objects that we
+/* In main() we just instantiate each of the four test objects that we
created. After open()ing each, we wait() for it's threads to exit.
*/
int main(int, char **)
@@ -232,18 +235,18 @@ int main(int, char **)
Test_ne test_ne(5);
test_ne.open();
test_ne.wait();
-
+
Test_ge test_ge(5);
test_ge.open();
test_ge.wait();
-
+
Test_le test_le(5);
test_le.open();
test_le.wait();
-
+
Test_fo test_fo(5);
test_fo.open();
test_fo.wait();
-
+
return(0);
}
diff --git a/docs/tutorials/016/page01.html b/docs/tutorials/016/page01.html
index 8781d692e14..25e2ea1c78b 100644
--- a/docs/tutorials/016/page01.html
+++ b/docs/tutorials/016/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -13,17 +14,17 @@
<P>
<HR WIDTH="100%">
The ACE framework has quite a few objects for syncronizing your
-threads and even processes. We've mentioned a few in passing already:
+threads and even processes. We've mentioned a few in passing already:
ACE_Thread_Mutex and ACE_Barrier for instance.
<P>
Another interesting one is the ACE_Condition template. By using an
-ACE_Condition you can have your code wait for an arbitrary condition
+ACE_Condition you can have your code wait for an arbitrary condition
to occur. That condition is "embodied" in a variable of your choice.
That variable can, in turn, be any data type you wish. This makes
ACE_Condition much more flexible than a simple mutex, barrier or
semaphore.
<P>
-In this tutorial, I'll create a wrapper class around the ACE_Condition
+In this tutorial, I'll create a wrapper class around the ACE_Condition
and the assorted housekeeping items necessary to make it work. I'll
use a simple integer as the condition variable but keep in mind that
you can use any data type you want.
@@ -33,11 +34,11 @@ Kirthika's abstract:
An ACE_Condition class is a synchronisation mechanism employed in
situations where one or more threads cannot access the shared resource
unless some 'condition' becomes true. The ACE_Condition is associated
-with a Mutex-lock which is released before blocking internally in the
-wait call. Once the blocked thread is signaled to wake up again it
-internally re-acquires the lock before checking the condition.
-Unless the condition is true and it has the lock, it cant go ahead.
-Once the shared resource is freed, a signal is sent to the waiting
+with a Mutex-lock which is released before blocking internally in the
+wait call. Once the blocked thread is signaled to wake up again it
+internally re-acquires the lock before checking the condition.
+Unless the condition is true and it has the lock, it cant go ahead.
+Once the shared resource is freed, a signal is sent to the waiting
threads which can now contend for the lock and access the resource.
<P>
Pizza-delivery metaphor: (courtesy Dr.Schmidt)
@@ -53,15 +54,15 @@ unavailable, the boys go to sleep. When the van returns and the keys
are returned, the current user of the van nudges the other sleeping boys
to wake up and fight for the keys. Once the keys are obtained and the
pizza
-is ready and out of the kitchen, the boy with the pizza and the keys can
+is ready and out of the kitchen, the boy with the pizza and the keys can
now deliver it.
</ul>
<P>
-This tutorial makes use of a wrapper class around the ACE_Condition and
+This tutorial makes use of a wrapper class around the ACE_Condition and
uses a integer value as the condition. The four kinds of condition
implemented
are: !=, >=, <=, == by using C++ operator overloading. Guards are used
-within
+within
the methods to make sure that the method is thread-safe. Once the thread
completes
its job, it broadcasts to the waiting on it.
@@ -73,7 +74,7 @@ Five threads are spwaned which in turn increment the condition
variable, which is initialised to 1 by 2. Remember that you are waiting
on
the <= condition. So once 3 threads have been thru it, the value becomes
-6
+6
and the condition becomes true!
<P>
This simple example shows us how to program and use the Condition
diff --git a/docs/tutorials/016/page02.html b/docs/tutorials/016/page02.html
index 21d9b282e4c..b43c18e5a87 100644
--- a/docs/tutorials/016/page02.html
+++ b/docs/tutorials/016/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -33,7 +34,7 @@ while( the_variable != some_desired_state_or_value )
the_mutex.release();
</PRE>
Note that when <i>the_condition</i> is created, it must be given a
-reference to the mutex. That's because the wait() method will release
+reference to the mutex. That's because the wait() method will release
the mutex before waiting and reacquire it after being signaled.
</UL>
<P>
@@ -52,9 +53,9 @@ the locking, waiting and signaling. Even if I remember it all
correctly it just makes my application code more complex than it
should be.
<P>
-To help out with that, I've created the class below to encapsulate the
+To help out with that, I've created the class below to encapsulate the
three elements necessary for the condition to work. I've then added
-methods for manipulation of the condition variable and waiting for the
+methods for manipulation of the condition variable and waiting for the
condition to occur.
<HR>
<PRE>
@@ -81,7 +82,7 @@ public:
<font color=red>// From here on I'll use value_t instead of 'int' to make any</font>
<font color=red>// future upgrades easier.</font>
typedef int value_t;
-
+
<font color=red>// Initialize the condition variable</font>
Condition (value_t value = 0);
~Condition (void);
@@ -166,7 +167,7 @@ public:
Just be sure that _compare(value_) will return non-zero when you
consider the condition to be met. */</font>
int operator== (Compare & compare);
-
+
private:
<font color=red>// Prevent copy construction and assignment.</font>
Condition (const Condition &condition);
diff --git a/docs/tutorials/016/page03.html b/docs/tutorials/016/page03.html
index 4c4077a415a..55bbb273f89 100644
--- a/docs/tutorials/016/page03.html
+++ b/docs/tutorials/016/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -14,7 +15,7 @@
<HR WIDTH="100%">
Ok, now we'll take a look at the definition of the class. You already
know how to use an ACE_Condition & it's not really that difficult.
-Still, imagine how much more cluttered your code would be if it had to
+Still, imagine how much more cluttered your code would be if it had to
include the mess I've got below!
<HR>
<PRE>
@@ -42,7 +43,7 @@ include the mess I've got below!
}
<font color=red>/* The cast operator is the easiest way to return a copy of the value
- to clients of the class. It also allows us to use a private method
+ to clients of the class. It also allows us to use a private method
for getting a reference to the value when we need to modify it.
*/</font>
<font color=#008888>Condition::operator</font> Condition::value_t (void)
@@ -54,12 +55,12 @@ include the mess I've got below!
}
<font color=red>/* Traditional prefix increment operator.
- We place a guard around the operation so that we don't collide with
+ We place a guard around the operation so that we don't collide with
any other threads. After the modification, we broadcast() a
- condition change to any waiting threads. You can also use signal()
+ condition change to any waiting threads. You can also use signal()
but that will only tell one thread about the change. If that
thread, in turn, invokes signal() then all threads will eventually
- find out. I just thought it would be easier to use broadcast() and
+ find out. I just thought it would be easier to use broadcast() and
be done with it.
*/</font>
Condition & <font color=#008888>Condition::operator</font>++ (void)
diff --git a/docs/tutorials/016/page04.html b/docs/tutorials/016/page04.html
index c9cc4dc6b4b..c31e2051fc5 100644
--- a/docs/tutorials/016/page04.html
+++ b/docs/tutorials/016/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -38,7 +39,7 @@ public:
<font color=red>// Open the Task with enough threads to make a useful test.</font>
int open(void);
-
+
protected:
<font color=red>// Each thread will do work on the Condition.</font>
int svc(void);
@@ -77,13 +78,16 @@ protected:
int <font color=#008888>Test::open</font>(void)
{
seed_ = <font color=#008888>ACE_OS::gettimeofday</font>().usec();
-
+
<font color=#008888>ACE_OS::srand</font>( seed_ );
-
+
+ <font color=red>// This is not a place where we want to use THR_DETACHED.</font>
+ <font color=red>// We're going to be waiting for our threads and if we detach</font>
+ <font color=red>// them, we'll loose track and horrible things will happen.</font>
return this->activate(THR_NEW_LWP, max_threads_);
}
-<font color=red>/* Each thread will modify the condition variable in some way and then
+<font color=red>/* Each thread will modify the condition variable in some way and then
wait for the condition to be satisfied. The derived classes
overload modify() and test() to implement a specific test of the
Condition class.
@@ -94,19 +98,19 @@ int <font color=#008888>Test::svc</font>(void)
<font color=red>// cause test() in other threads to delay a bit.</font>
int stime = <font color=#008888>ACE_OS::rand_r</font>( seed_ ) % 5;
<font color=#008888>ACE_OS::sleep</font>(abs(stime)+2);
-
+
ACE_DEBUG ((LM_INFO, "<font color=green>(%P|%t|%T)\<font color=#008888>tTest::svc</font>() befor modify, condition_ is: %d\n</font>", (int)condition_ ));
<font color=red>// Change the condition variable's value</font>
modify();
-
+
ACE_DEBUG ((LM_INFO, "<font color=green>(%P|%t|%T)\<font color=#008888>tTest::svc</font>() after modify, condition_ is: %d\n</font>", (int)condition_ ));
<font color=red>// Test for the condition we want</font>
test();
-
+
ACE_DEBUG ((LM_INFO, "<font color=green>(%P|%t|%T)\<font color=#008888>tTest::svc</font>() leaving.\n</font>" ));
-
+
return(0);
}
@@ -245,7 +249,7 @@ public:
}
};
-<font color=red>/* In main() we just instantiate each of the four test objects that we
+<font color=red>/* In main() we just instantiate each of the four test objects that we
created. After open()ing each, we wait() for it's threads to exit.
*/</font>
int main(int, char **)
@@ -253,19 +257,19 @@ int main(int, char **)
Test_ne test_ne(5);
test_ne.open();
test_ne.wait();
-
+
Test_ge test_ge(5);
test_ge.open();
test_ge.wait();
-
+
Test_le test_le(5);
test_le.open();
test_le.wait();
-
+
Test_fo test_fo(5);
test_fo.open();
test_fo.wait();
-
+
return(0);
}
</PRE>
diff --git a/docs/tutorials/016/page05.html b/docs/tutorials/016/page05.html
index baf3eb23a4a..12c6f1dfb33 100644
--- a/docs/tutorials/016/page05.html
+++ b/docs/tutorials/016/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/017/Barrier_i.cpp b/docs/tutorials/017/Barrier_i.cpp
index 0d9f0c67398..0784205360a 100644
--- a/docs/tutorials/017/Barrier_i.cpp
+++ b/docs/tutorials/017/Barrier_i.cpp
@@ -56,7 +56,7 @@ int Barrier::threads( u_int _threads, int _wait )
}
threads_ = _threads;
-
+
return make_barrier(_wait);
}
@@ -79,7 +79,7 @@ int Barrier::wait(void)
{
// mutex so that only one thread can do this part.
ACE_Guard<ACE_Mutex> mutex(barrier_mutex_);
-
+
// We only want the first thread to plug in the new barrier...
if( new_barrier_ )
{
diff --git a/docs/tutorials/017/Barrier_i.h b/docs/tutorials/017/Barrier_i.h
index 5d86ce007af..200f76464a3 100644
--- a/docs/tutorials/017/Barrier_i.h
+++ b/docs/tutorials/017/Barrier_i.h
@@ -49,7 +49,7 @@ protected:
// The ACE_Barrier that does all of the work
ACE_Barrier *barrier_;
- // If we mutate the number of threads we have to do some black magic
+ // If we mutate the number of threads we have to do some black magic
// to make sure there isn't a memory leak. These two member
// variables are a part of that magic.
ACE_Barrier *new_barrier_;
@@ -62,5 +62,5 @@ protected:
// An internal method that constructs the barrier_ as needed.
int make_barrier (int wait);
};
-
+
#endif /* BARRIER_H */
diff --git a/docs/tutorials/017/barrier.cpp b/docs/tutorials/017/barrier.cpp
index eb9a5c14586..93caedee8b3 100644
--- a/docs/tutorials/017/barrier.cpp
+++ b/docs/tutorials/017/barrier.cpp
@@ -43,20 +43,22 @@ Test::Test(int _threads)
{
}
-/* As usual, our open() will create one or more threads where we'll do
+/* As usual, our open() will create one or more threads where we'll do
the interesting work.
-*/
+*/
int Test::open(void * _unused)
{
ACE_UNUSED_ARG(_unused);
// One thing about the barrier: You have to tell it how many
// threads it will be synching. The threads() mutator on my
- // Barrier class lets you do that and hides the implementation
+ // Barrier class lets you do that and hides the implementation
// details at the same time.
barrier_.threads(threads_);
- // Activate the tasks as usual...
+ // Activate the tasks as usual... Like the other cases where
+ // we're joining (or waiting for) our threads, we can't use
+ // THR_DETACHED.
return this->activate(THR_NEW_LWP, threads_);
}
@@ -78,14 +80,14 @@ int Test::svc(void)
ACE_DEBUG ((LM_INFO, "(%P|%t|%T)\tTest::svc() Entry\n"));
// Initialize the random number generator. We'll use this to
- // create sleep() times in each thread. This will help us see
+ // create sleep() times in each thread. This will help us see
// if the barrier synch is working.
ACE_Time_Value now(ACE_OS::gettimeofday());
ACE_RANDR_TYPE seed = now.usec();
ACE_OS::srand(seed);
int delay;
- // After saying hello above, sleep for a random amount of time
+ // After saying hello above, sleep for a random amount of time
// from 1 to 6 seconds. That will cause the next message
// "Entering wait()" to be staggered on the output as each
// thread's sleep() returns.
@@ -105,7 +107,7 @@ int Test::svc(void)
return 0;
}
- // When all threads have reached wait() they will give us this
+ // When all threads have reached wait() they will give us this
// message. If you execute this, you should see all of the
// "Everybody together" messages at about the same time.
ACE_DEBUG ((LM_INFO, "(%P|%t|%T)\tTest::svc() Everybody together?\n"));
@@ -118,7 +120,7 @@ int Test::svc(void)
ACE_DEBUG ((LM_INFO, "(%P|%t|%T)\tTest::svc() Entering done()\n"));
// This time we call done() instead of wait(). done()
- // actually invokes wait() but before returning here, it will
+ // actually invokes wait() but before returning here, it will
// clean up a few resources. The goal is to prevent carrying
// around objects you don't need.
if( barrier_.done() == -1 )
@@ -134,7 +136,7 @@ int Test::svc(void)
// A final sleep()
delay = ACE_OS::rand_r(seed)%5;
ACE_OS::sleep(abs(delay)+1);
-
+
// These should be randomly spaced like all of the other
// post-sleep messages.
ACE_DEBUG ((LM_INFO, "(%P|%t|%T)\tTest::svc() Chaos and anarchy for all!\n"));
@@ -159,6 +161,6 @@ int main(int, char**)
test.open();
// and wait for them to complete also.
test.wait();
-
+
return(0);
}
diff --git a/docs/tutorials/017/barrier2.cpp b/docs/tutorials/017/barrier2.cpp
index 4fce4e07e42..2ed76decc34 100644
--- a/docs/tutorials/017/barrier2.cpp
+++ b/docs/tutorials/017/barrier2.cpp
@@ -47,16 +47,16 @@ Test::Test(int _threads)
{
}
-/* As usual, our open() will create one or more threads where we'll do
+/* As usual, our open() will create one or more threads where we'll do
the interesting work.
-*/
+*/
int Test::open(void * _unused)
{
ACE_UNUSED_ARG(_unused);
// One thing about the barrier: You have to tell it how many
// threads it will be synching. The threads() mutator on my
- // Barrier class lets you do that and hides the implementation
+ // Barrier class lets you do that and hides the implementation
// details at the same time.
barrier_.threads(threads_);
@@ -97,7 +97,7 @@ int Test::svc(void)
int delay;
// We'll arbitrarily choose the first activated thread to be
- // the controller. After it sleeps a few seconds, it will add
+ // the controller. After it sleeps a few seconds, it will add
// five threads.
if( me == 1 )
{
@@ -121,7 +121,7 @@ int Test::svc(void)
}
// This for() loop represents an "infinite" work loop in an
- // application. The theory is that the threads are dividing up
+ // application. The theory is that the threads are dividing up
// some work but need to "recalibrate" if more threads are
// added. I'll just do five iterations so that the test
// doesn't run forever.
@@ -133,8 +133,8 @@ int Test::svc(void)
ACE_OS::sleep(abs(delay)+1);
ACE_DEBUG(( LM_INFO, "(%P|%t|%T)\tThread %.2d of %.2d iteration %.2d\n", me, threads_, i ));
-
- // If the local threads_ variable doesn't match the number
+
+ // If the local threads_ variable doesn't match the number
// in the barrier, then the controller must have changed
// the thread count. We'll wait() for everyone and then
// recalibrate ourselves before continuing.
diff --git a/docs/tutorials/017/combine.shar b/docs/tutorials/017/combine.shar
index 9595308932d..45741e7a0bc 100644
--- a/docs/tutorials/017/combine.shar
+++ b/docs/tutorials/017/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-02-24 16:56 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/017'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/017'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -12,14 +12,14 @@
# length mode name
# ------ ---------- ------------------------------------------
# 422 -rw-rw-r-- hdr
-# 64 -rw-rw-r-- bodies
+# 65 -rw-rw-r-- bodies
# 1397 -rw-rw-r-- page01.pre
# 420 -rw-rw-r-- page02.pre
# 739 -rw-rw-r-- page03.pre
# 479 -rw-rw-r-- page04.pre
# 375 -rw-rw-r-- page05.pre
-# 373 -rw-rw-r-- page06.pre
-# 216 -rw-rw-r-- page05.pst
+# 374 -rw-rw-r-- page06.pre
+# 217 -rw-rw-r-- page05.pst
#
save_IFS="${IFS}"
IFS="${IFS}:"
@@ -66,7 +66,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh29953; then
+if mkdir _sh05177; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -128,12 +128,12 @@ SHAR_EOF
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'bodies:' 'MD5 check failed'
-b6fd04983b241794a9438df2ae77055c bodies
+95ff65d56968b60df92224ca27a34387 bodies
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'bodies'`"
- test 64 -eq "$shar_count" ||
- $echo 'bodies:' 'original size' '64,' 'current size' "$shar_count!"
+ test 65 -eq "$shar_count" ||
+ $echo 'bodies:' 'original size' '65,' 'current size' "$shar_count!"
fi
fi
# ============= page01.pre ==============
@@ -342,12 +342,12 @@ SHAR_EOF
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page06.pre:' 'MD5 check failed'
-ad87cd9f57af4c9b2c91cb32b484c0d1 page06.pre
+0e05cdb27f2d6bfda8fc2246ed981aab page06.pre
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page06.pre'`"
- test 373 -eq "$shar_count" ||
- $echo 'page06.pre:' 'original size' '373,' 'current size' "$shar_count!"
+ test 374 -eq "$shar_count" ||
+ $echo 'page06.pre:' 'original size' '374,' 'current size' "$shar_count!"
fi
fi
# ============= page05.pst ==============
@@ -368,13 +368,13 @@ SHAR_EOF
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page05.pst:' 'MD5 check failed'
-7ce8bbac0d211a3616b5052236e4983b page05.pst
+2a706afa6c518293090c04e08eaf8992 page05.pst
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page05.pst'`"
- test 216 -eq "$shar_count" ||
- $echo 'page05.pst:' 'original size' '216,' 'current size' "$shar_count!"
+ test 217 -eq "$shar_count" ||
+ $echo 'page05.pst:' 'original size' '217,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh29953
+rm -fr _sh05177
exit 0
diff --git a/docs/tutorials/017/page01.html b/docs/tutorials/017/page01.html
index 25d4c94ae02..4288bffc58f 100644
--- a/docs/tutorials/017/page01.html
+++ b/docs/tutorials/017/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -17,17 +18,17 @@ The ACE_Barrier implements the barrier synchronization pattern.
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
+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
+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
+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>
diff --git a/docs/tutorials/017/page02.html b/docs/tutorials/017/page02.html
index fd6b3a1717c..47677ba8fa4 100644
--- a/docs/tutorials/017/page02.html
+++ b/docs/tutorials/017/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -67,9 +68,9 @@ protected:
{
}
-<font color=red>/* As usual, our open() will create one or more threads where we'll do
+<font color=red>/* As usual, our open() will create one or more threads where we'll do
the interesting work.
-*/</font>
+*/</font>
int <font color=#008888>Test::open</font>(void * _unused)
{
ACE_UNUSED_ARG(_unused);
@@ -80,7 +81,9 @@ int <font color=#008888>Test::open</font>(void * _unused)
<font color=red>// details at the same time.</font>
barrier_.threads(threads_);
- <font color=red>// Activate the tasks as usual...</font>
+ <font color=red>// Activate the tasks as usual... Like the other cases where</font>
+ <font color=red>// we're joining (or waiting for) our threads, we can't use</font>
+ <font color=red>// THR_DETACHED.</font>
return this->activate(THR_NEW_LWP, threads_);
}
@@ -158,7 +161,7 @@ int <font color=#008888>Test::svc</font>(void)
<font color=red>// A final sleep()</font>
delay = <font color=#008888>ACE_OS::rand_r</font>(seed)%5;
<font color=#008888>ACE_OS::sleep</font>(abs(delay)+1);
-
+
<font color=red>// These should be randomly spaced like all of the other</font>
<font color=red>// post-sleep messages.</font>
ACE_DEBUG ((LM_INFO, "<font color=green>(%P|%t|%T)\<font color=#008888>tTest::svc</font>() Chaos and anarchy for all!\n</font>"));
@@ -183,7 +186,7 @@ int main(int, char**)
test.open();
<font color=red>// and wait for them to complete also.</font>
test.wait();
-
+
return(0);
}
</PRE>
diff --git a/docs/tutorials/017/page03.html b/docs/tutorials/017/page03.html
index 3649337655b..ee86eed3a76 100644
--- a/docs/tutorials/017/page03.html
+++ b/docs/tutorials/017/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -15,14 +16,14 @@
The Barrier class used by the test task is a simple wrapper around
ACE_Barrier. One of the things about ACE_Barrier is that you have to
tell it how many threads it will be managing. Since that number
-usually isn't known when you create your Task derivative, you have to
+usually isn't known when you create your Task derivative, you have to
dynamically allocate the ACE_Barrier. My Barrier wrapper takes care
of that for you and even provides for a clean way to delete the
ACE_Barrier instance if you want to save a few bytes.
<P>
An interesting extension of this Barrier class would be to wrap it up
-in a smart pointer. You could then have the Barrier destructor invoke
-wait() as a now-protected method. The result would allow you to treat
+in a smart pointer. You could then have the Barrier destructor invoke
+wait() as a now-protected method. The result would allow you to treat
the Barrier object almost as a "synchronization guard".
<HR>
<PRE>
@@ -90,7 +91,7 @@ protected:
<font color=red>// An internal method that constructs the barrier_ as needed.</font>
int make_barrier (int wait);
};
-
+
<font color=blue>#endif</font> <font color=red>/* BARRIER_H */</font>
</PRE>
<P><HR WIDTH="100%">
diff --git a/docs/tutorials/017/page04.html b/docs/tutorials/017/page04.html
index 88ff60be565..b725c19324a 100644
--- a/docs/tutorials/017/page04.html
+++ b/docs/tutorials/017/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -79,7 +80,7 @@ int <font color=#008888>Barrier::threads</font>( u_int _threads, int _wait )
}
threads_ = _threads;
-
+
return make_barrier(_wait);
}
@@ -102,7 +103,7 @@ int <font color=#008888>Barrier::wait</font>(void)
{
<font color=red>// mutex so that only one thread can do this part.</font>
ACE_Guard&lt;ACE_Mutex> mutex(barrier_mutex_);
-
+
<font color=red>// We only want the first thread to plug in the new barrier...</font>
if( new_barrier_ )
{
@@ -175,6 +176,12 @@ int <font color=#008888>Barrier::make_barrier</font>( int _wait )
return 0;
}
+
+<font color=blue>#if defined</font> (<font color=purple>ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION</font>)
+template class ACE_Atomic_Op &lt;ACE_Mutex, u_int>;
+<font color=blue>#elif defined</font> (<font color=purple>ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA</font>)
+<font color=blue>#pragma</font> <font color=purple>instantiate</font> ACE_Atomic_Op &lt;ACE_Mutex, u_int>
+<font color=blue>#endif</font> <font color=red>/* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */</font>
</PRE>
<P><HR WIDTH="100%">
<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page05.html">Continue This Tutorial</A>]</CENTER>
diff --git a/docs/tutorials/017/page05.html b/docs/tutorials/017/page05.html
index f5be1185260..0bbd7061978 100644
--- a/docs/tutorials/017/page05.html
+++ b/docs/tutorials/017/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -23,7 +24,7 @@ enhancements will gladly be integrated into the Tutorial.
<LI><A HREF="Barrier_i.cpp">Barrier_i.cpp</A>
</UL>
<HR>
-Before we call it a wrap though, there's one more thing I want to show
+Before we call it a wrap though, there's one more thing I want to show
you. Remember the comments around Barrier::threads()? On the next
page, I'll show you how to synch up when the number of threads changes.
<P><HR WIDTH="100%">
diff --git a/docs/tutorials/017/page06.html b/docs/tutorials/017/page06.html
index 1bd396d156e..cf89e214cd9 100644
--- a/docs/tutorials/017/page06.html
+++ b/docs/tutorials/017/page06.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -70,9 +71,9 @@ protected:
{
}
-<font color=red>/* As usual, our open() will create one or more threads where we'll do
+<font color=red>/* As usual, our open() will create one or more threads where we'll do
the interesting work.
-*/</font>
+*/</font>
int <font color=#008888>Test::open</font>(void * _unused)
{
ACE_UNUSED_ARG(_unused);
@@ -156,7 +157,7 @@ int <font color=#008888>Test::svc</font>(void)
<font color=#008888>ACE_OS::sleep</font>(abs(delay)+1);
ACE_DEBUG(( LM_INFO, "<font color=green>(%P|%t|%T)\tThread %.2d of %.2d iteration %.2d\n</font>", me, threads_, i ));
-
+
<font color=red>// If the local threads_ variable doesn't match the number </font>
<font color=red>// in the barrier, then the controller must have changed</font>
<font color=red>// the thread count. We'll wait() for everyone and then</font>
diff --git a/docs/tutorials/018/Test_T.cpp b/docs/tutorials/018/Test_T.cpp
index 73d5549d3ca..a0f2f767e23 100644
--- a/docs/tutorials/018/Test_T.cpp
+++ b/docs/tutorials/018/Test_T.cpp
@@ -15,7 +15,7 @@
/* Construction time...
Initialize the baseclass, the name and the barrier. Since the
- client will probably invoke run() next, we go ahead an announce our
+ client will probably invoke run() next, we go ahead an announce our
creation to make the output more readable.
*/
template <class MUTEX>
@@ -31,7 +31,7 @@ Test_T<MUTEX>::Test_T (const char *name)
/* Activate the threads and create some test data...
*/
-template <class MUTEX> int
+template <class MUTEX> int
Test_T<MUTEX>::run (void)
{
// Try to activate the set of threads that will test the mutex
@@ -71,7 +71,7 @@ Test_T<MUTEX>::run (void)
/* Send a message to the thread pool
*/
-template <class MUTEX> int
+template <class MUTEX> int
Test_T<MUTEX>::send (ACE_Message_Block *message)
{
// If no message was provided, create a hangup message.
@@ -101,7 +101,7 @@ Test_T<MUTEX>::send (ACE_Message_Block *message)
/* A farily typical open(). Just activate the set of threads and return.
*/
-template <class MUTEX> int
+template <class MUTEX> int
Test_T<MUTEX>::open (void *arg)
{
ACE_UNUSED_ARG(arg);
@@ -109,10 +109,10 @@ Test_T<MUTEX>::open (void *arg)
TEST_THREAD_COUNT);
}
-/* svc() is also fairly typical. The new part is the use of the guard
+/* svc() is also fairly typical. The new part is the use of the guard
to simulate protection of shared resources.
*/
-template <class MUTEX> int
+template <class MUTEX> int
Test_T<MUTEX>::svc (void)
{
// Keep a simple thread identifier. We could always use the
@@ -185,7 +185,7 @@ Test_T<MUTEX>::svc (void)
// this then wait() will never exit since all of the other threads
// are still blocked on getq().
this->send ();
-
+
return 0;
};
diff --git a/docs/tutorials/018/Test_T.h b/docs/tutorials/018/Test_T.h
index d17f902b83c..2dee0e7f9ed 100644
--- a/docs/tutorials/018/Test_T.h
+++ b/docs/tutorials/018/Test_T.h
@@ -10,8 +10,8 @@
force our client into using the run() method instead.
The naming convention *_T is fairly typical for ACE. The _T suffix
- on the object name (and it's source files) indicates that this is a
- templated class. Generally, there is a non-templated class defined
+ on the object name (and it's source files) indicates that this is a
+ templated class. Generally, there is a non-templated class defined
also such as foobar.h that would be included instead of foobar_T.h.
*/
@@ -27,7 +27,7 @@ public:
// the task's threads. We then add a number of messages to the
// queue for svc() to process.
int run (void);
-
+
protected:
// Activate a few threads
@@ -62,9 +62,9 @@ protected:
mutex_t mutex_;
};
-/* Although different compilers differ in their details, almost all of
+/* Although different compilers differ in their details, almost all of
them require that you provide the definition of the templated
- object along with the declaration. With any luck, this will change
+ object along with the declaration. With any luck, this will change
someday & we'll have smaller object files. Until then, the lines
below will take care of you.
*/
diff --git a/docs/tutorials/018/combine.shar b/docs/tutorials/018/combine.shar
index 274d7e39816..0a8f3f7b0c8 100644
--- a/docs/tutorials/018/combine.shar
+++ b/docs/tutorials/018/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-02-24 17:02 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/018'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/018'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -66,7 +66,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh30135; then
+if mkdir _sh05205; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -436,5 +436,5 @@ SHAR_EOF
$echo 'page07.pre:' 'original size' '478,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh30135
+rm -fr _sh05205
exit 0
diff --git a/docs/tutorials/018/page01.html b/docs/tutorials/018/page01.html
index 871e8070558..878663de2b8 100644
--- a/docs/tutorials/018/page01.html
+++ b/docs/tutorials/018/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -21,8 +22,8 @@ ACE_Token has a really cool thing: it behaves in a FIFO manner.
<P>
Why is that cool?
<P>
-In the other tutorials, you may have found that one thread will end up
-with all of the work. Even though other threads are available, the OS
+In the other tutorials, you may have found that one thread will end up
+with all of the work. Even though other threads are available, the OS
scheduling and lock management just causes it to happen. With
ACE_Token, the threads are queued up on the token and served in a
traditional first-in-first-out manner.
@@ -46,23 +47,23 @@ threads work harder than others.
<P>
Kirthika's abstract:
<UL>
-A token is similar to a mutex-lock, with the difference being that
-the token is given to the waiting threads in a FIFO order. In the case
-of the mutex-lock, any thread (depending on the OS) could acquire
-the lock when its released. It internally implements a recursive mutex,
-i.e. the thread that owns the mutex can reqacquire it without deadlocking.
-The token also has two FIFO lists for writers and readers with writer-
-acquires having a higher priority than reader-acquires.
+A token is similar to a mutex-lock, with the difference being that
+the token is given to the waiting threads in a FIFO order. In the case
+of the mutex-lock, any thread (depending on the OS) could acquire
+the lock when its released. It internally implements a recursive mutex,
+i.e. the thread that owns the mutex can reqacquire it without deadlocking.
+The token also has two FIFO lists for writers and readers with writer-
+acquires having a higher priority than reader-acquires.
<P>
-This tutorial throws light on the differences on having a shared resource governed by
-a lock and a token, both derive from a Task which simply updates a counter with the
-number-of-threads value. A barrier is used for ensuring that all threads get a equal
-opportunity of grabbing the token. The message queue with the message containing the
-thread count moves among the threads to be obtained and read.
+This tutorial throws light on the differences on having a shared resource governed by
+a lock and a token, both derive from a Task which simply updates a counter with the
+number-of-threads value. A barrier is used for ensuring that all threads get a equal
+opportunity of grabbing the token. The message queue with the message containing the
+thread count moves among the threads to be obtained and read.
<P>
-On obtaining the results, we conclude that on using the Token, the job to be completed
-can be distributed evenly among available threads. This cant be guaranteed
-in case of simply using the lock for synchronisation.
+On obtaining the results, we conclude that on using the Token, the job to be completed
+can be distributed evenly among available threads. This cant be guaranteed
+in case of simply using the lock for synchronisation.
</ul>
<P><HR WIDTH="100%">
<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page02.html">Continue This Tutorial</A>]</CENTER>
diff --git a/docs/tutorials/018/page02.html b/docs/tutorials/018/page02.html
index b317db06226..de814644784 100644
--- a/docs/tutorials/018/page02.html
+++ b/docs/tutorials/018/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -38,9 +39,22 @@ int main(int,char**)
<font color=red>// And now the ACE_Mutex.</font>
Mutex mutex;
mutex.run();
-
+
return(0);
}
+<font color=blue>#if defined</font> (<font color=purple>ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION</font>)
+template class Test_T &lt;ACE_Mutex>;
+template class Test_T &lt;ACE_Token>;
+template class ACE_Atomic_Op &lt;ACE_Mutex, int>;
+<font color=blue>#elif defined</font> (<font color=purple>ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA</font>)
+<font color=blue>#pragma</font> <font color=purple>instantiate</font> Test_T &lt;ACE_Mutex>
+<font color=blue>#pragma</font> <font color=purple>instantiate</font> Test_T &lt;ACE_Token>
+<font color=blue>#pragma</font> <font color=purple>instantiate</font> ACE_Atomic_Op &lt;ACE_Mutex, int>
+<font color=blue>#endif</font> <font color=red>/* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */</font>
+
+
+
+
</PRE>
<P><HR WIDTH="100%">
<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page03.html">Continue This Tutorial</A>]</CENTER>
diff --git a/docs/tutorials/018/page03.html b/docs/tutorials/018/page03.html
index 100b332e1fb..d9ab9c3c6b4 100644
--- a/docs/tutorials/018/page03.html
+++ b/docs/tutorials/018/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -18,7 +19,7 @@ we've created one of our own.
<P>
In a lot of ways, you can think of templates as the sophisticated
cousin of the old C-style pre-processor macros. With templates,
-however, you get better type-checking and much easier debugging. There
+however, you get better type-checking and much easier debugging. There
are certainly other benefits but these are my favorites.
<P>
Our template's MUTEX parameter is used to set the mutex type
@@ -28,9 +29,9 @@ message queue.
<P>
Note at the bottom how we have to include the <i>cpp</i> file
associated with us. Most compilers have to see the definition of
-templated classes along with their declaration. You might be tempted,
+templated classes along with their declaration. You might be tempted,
therefore, to just put the definitions in the header file. Resist
-that temptation because templates are one of the fastest growing areas
+that temptation because templates are one of the fastest growing areas
of compilers. Including the definition like we do here leads to long
compile times and overly-large binaries. With luck, the compilers
will get smarter in the future and we won't need definition
@@ -50,8 +51,8 @@ yourself a lot of time!
force our client into using the run() method instead.
The naming convention *_T is fairly typical for ACE. The _T suffix
- on the object name (and it's source files) indicates that this is a
- templated class. Generally, there is a non-templated class defined
+ on the object name (and it's source files) indicates that this is a
+ templated class. Generally, there is a non-templated class defined
also such as foobar.h that would be included instead of foobar_T.h.
*/</font>
@@ -67,7 +68,7 @@ public:
<font color=red>// the task's threads. We then add a number of messages to the</font>
<font color=red>// queue for svc() to process.</font>
int run (void);
-
+
protected:
<font color=red>// Activate a few threads</font>
@@ -102,9 +103,9 @@ protected:
mutex_t mutex_;
};
-<font color=red>/* Although different compilers differ in their details, almost all of
+<font color=red>/* Although different compilers differ in their details, almost all of
them require that you provide the definition of the templated
- object along with the declaration. With any luck, this will change
+ object along with the declaration. With any luck, this will change
someday & we'll have smaller object files. Until then, the lines
below will take care of you.
*/</font>
diff --git a/docs/tutorials/018/page04.html b/docs/tutorials/018/page04.html
index b83ab46f653..16828c1372f 100644
--- a/docs/tutorials/018/page04.html
+++ b/docs/tutorials/018/page04.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%">
-Our Test implementation looks much like the other ACE_Task derivatives
+Our Test implementation looks much like the other ACE_Task derivatives
we've used in the past. The most obvious change is the addition of
the run() method. run() will activate the threads and put a few
messages into the queue. We could have done that in main() but it
@@ -43,7 +44,7 @@ resources that the threads might clobber.
<font color=red>/* Construction time...
Initialize the baseclass, the name and the barrier. Since the
- client will probably invoke run() next, we go ahead an announce our
+ client will probably invoke run() next, we go ahead an announce our
creation to make the output more readable.
*/</font>
template &lt;class MUTEX>
@@ -59,7 +60,7 @@ Test_T&lt;MUTEX>::Test_T (const char *name)
<font color=red>/* Activate the threads and create some test data...
*/</font>
-template &lt;class MUTEX> int
+template &lt;class MUTEX> int
Test_T&lt;MUTEX>::run (void)
{
<font color=red>// Try to activate the set of threads that will test the mutex</font>
@@ -99,7 +100,7 @@ Test_T&lt;MUTEX>::run (void)
<font color=red>/* Send a message to the thread pool
*/</font>
-template &lt;class MUTEX> int
+template &lt;class MUTEX> int
Test_T&lt;MUTEX>::send (ACE_Message_Block *message)
{
<font color=red>// If no message was provided, create a hangup message.</font>
@@ -129,7 +130,7 @@ Test_T&lt;MUTEX>::send (ACE_Message_Block *message)
<font color=red>/* A farily typical open(). Just activate the set of threads and return.
*/</font>
-template &lt;class MUTEX> int
+template &lt;class MUTEX> int
Test_T&lt;MUTEX>::open (void *arg)
{
ACE_UNUSED_ARG(arg);
@@ -137,10 +138,10 @@ Test_T&lt;MUTEX>::open (void *arg)
TEST_THREAD_COUNT);
}
-<font color=red>/* svc() is also fairly typical. The new part is the use of the guard
+<font color=red>/* svc() is also fairly typical. The new part is the use of the guard
to simulate protection of shared resources.
*/</font>
-template &lt;class MUTEX> int
+template &lt;class MUTEX> int
Test_T&lt;MUTEX>::svc (void)
{
<font color=red>// Keep a simple thread identifier. We could always use the</font>
@@ -213,7 +214,7 @@ Test_T&lt;MUTEX>::svc (void)
<font color=red>// this then wait() will never exit since all of the other threads</font>
<font color=red>// are still blocked on getq().</font>
this->send ();
-
+
return 0;
};
diff --git a/docs/tutorials/018/page05.html b/docs/tutorials/018/page05.html
index fb846de5e37..ce1f6cde16f 100644
--- a/docs/tutorials/018/page05.html
+++ b/docs/tutorials/018/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -13,7 +14,7 @@
<P>
<HR WIDTH="100%">
Here we create simple derivatives of our Test templated class. Each
-is parameterized with our mutex of choice and "named". Using the Test
+is parameterized with our mutex of choice and "named". Using the Test
template we're able to reuse all of the code with practially no
retyping and certainly much less chance of error!
<HR>
diff --git a/docs/tutorials/018/page06.html b/docs/tutorials/018/page06.html
index f26fa5a5452..666cc7ea968 100644
--- a/docs/tutorials/018/page06.html
+++ b/docs/tutorials/018/page06.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -16,7 +17,7 @@ That's it for the code, now let's take a quick look at some output.
The first set of output is from the Token test, the second is Mutex
test. Notice how the threads are evenly utilized in the Token test.
Each thread gets to see exactly two messages. There's also an
-interesting side-effect that the messages are processed in order. (You
+interesting side-effect that the messages are processed in order. (You
can't rely on that, it just happend in this particular run.)
<P>
With the Mutex test, however, we see that the first thread gets no
@@ -25,11 +26,11 @@ governor in svc() it might have gotten them all!
<P>
Why does this happen?
<P>
-Primarily because of time slicing. Even though each thread takes time
-to do work (1 second in our test), it can still own the timeslice when
+Primarily because of time slicing. Even though each thread takes time
+to do work (1 second in our test), it can still own the timeslice when
it gets back to the mutex acquire. Since the other threads are still
switched out, the current thread regets the lock and continues. On
-the other hand, the ACE_Token is very careful about the order in which
+the other hand, the ACE_Token is very careful about the order in which
the acquisition is allowed and more evenly distributes the work.
<P>
Play around with the sleep() call in svc(). You'll find that as you
diff --git a/docs/tutorials/018/page07.html b/docs/tutorials/018/page07.html
index 528df2ad61c..31c29d111e5 100644
--- a/docs/tutorials/018/page07.html
+++ b/docs/tutorials/018/page07.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -12,9 +13,9 @@
<P>
<HR WIDTH="100%">
-And now we're at the end of another Tutorial. As always, feel free to
+And now we're at the end of another Tutorial. As always, feel free to
send in questions and comments. There are certainly more
-implementation possibilites and I'll gladly integrate yours into these
+implementation possibilites and I'll gladly integrate yours into these
Tutorials.
<P>
<UL>
diff --git a/docs/tutorials/018/token.cpp b/docs/tutorials/018/token.cpp
index 1323dcaa9b4..040a6ead6c6 100644
--- a/docs/tutorials/018/token.cpp
+++ b/docs/tutorials/018/token.cpp
@@ -14,7 +14,7 @@ int main(int,char**)
// And now the ACE_Mutex.
Mutex mutex;
mutex.run();
-
+
return(0);
}
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
diff --git a/docs/tutorials/019/client.cpp b/docs/tutorials/019/client.cpp
index b47cf8b1503..cf57b8ec2ec 100644
--- a/docs/tutorials/019/client.cpp
+++ b/docs/tutorials/019/client.cpp
@@ -4,7 +4,7 @@
#include "shmem.h"
#if defined(ACE_LACKS_SYSV_SHMEM)
-int
+int
main (int, char *[])
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -12,7 +12,7 @@ main (int, char *[])
100);
}
#else // ACE_LACKS_SYSV_SHMEM
-int
+int
main (int, char *[])
{
/*
@@ -26,9 +26,9 @@ main (int, char *[])
char *shm = (char *) shm_client.malloc ();
/*
- If the segment identified by SHM_KEY didn't exist then we'll
+ If the segment identified by SHM_KEY didn't exist then we'll
get back a 0 from malloc(). You should do this check even
- if you include the CREATE flag 'cause you never know when it
+ if you include the CREATE flag 'cause you never know when it
might fail.
*/
if (shm == 0)
@@ -52,7 +52,7 @@ main (int, char *[])
putchar (*s);
*s = toupper(*s);
}
-
+
putchar ('\n');
/*
diff --git a/docs/tutorials/019/client2.cpp b/docs/tutorials/019/client2.cpp
index 7bdcf3ffb3c..e58d55e32d7 100644
--- a/docs/tutorials/019/client2.cpp
+++ b/docs/tutorials/019/client2.cpp
@@ -3,7 +3,7 @@
#include "shmem.h"
#if defined(ACE_LACKS_SYSV_SHMEM)
-int
+int
main (int, char *[])
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -11,12 +11,12 @@ main (int, char *[])
100);
}
#else // ACE_LACKS_SYSV_SHMEM
-int
+int
main (int, char *[])
{
ACE_Shared_Memory_SV shm_client (SHM_KEY,
sizeof (SharedData));
-
+
char *shm = (char *) shm_client.malloc ();
ACE_DEBUG ((LM_INFO,
@@ -25,7 +25,7 @@ main (int, char *[])
/*
More placement new. The constructor parameter prevents
- clobbering what the server may have written with it's show()
+ clobbering what the server may have written with it's show()
method.
*/
SharedData *sd = new (shm) SharedData (0);
@@ -40,7 +40,7 @@ main (int, char *[])
sd->available (1);
shm_client.close ();
-
+
return 0;
}
diff --git a/docs/tutorials/019/combine.shar b/docs/tutorials/019/combine.shar
index d05038bee74..321d6243edd 100644
--- a/docs/tutorials/019/combine.shar
+++ b/docs/tutorials/019/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:08 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/019'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/019'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -13,7 +13,7 @@
# ------ ---------- ------------------------------------------
# 409 -rw-rw-r-- hdr
# 71 -rw-rw-r-- bodies
-# 2009 -rw-rw-r-- page01.pre
+# 2010 -rw-rw-r-- page01.pre
# 563 -rw-rw-r-- page02.pre
# 219 -rw-rw-r-- page03.pre
# 676 -rw-rw-r-- page04.pre
@@ -65,7 +65,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh12976; then
+if mkdir _sh05234; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -192,12 +192,12 @@ SHAR_EOF
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page01.pre:' 'MD5 check failed'
-fae9aec33b3cc43e8c06d608e00adf2f page01.pre
+5679e782c6b5d10a12a894cee1d88bc0 page01.pre
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page01.pre'`"
- test 2009 -eq "$shar_count" ||
- $echo 'page01.pre:' 'original size' '2009,' 'current size' "$shar_count!"
+ test 2010 -eq "$shar_count" ||
+ $echo 'page01.pre:' 'original size' '2010,' 'current size' "$shar_count!"
fi
fi
# ============= page02.pre ==============
@@ -354,5 +354,5 @@ SHAR_EOF
$echo 'page06.pre:' 'original size' '401,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh12976
+rm -fr _sh05234
exit 0
diff --git a/docs/tutorials/019/page01.html b/docs/tutorials/019/page01.html
index 1aa30b6aa2e..21cc0af6beb 100644
--- a/docs/tutorials/019/page01.html
+++ b/docs/tutorials/019/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -25,13 +26,13 @@
<p>
Along the way, we'll have to come up with some sort of
coordination betweent the processes. That is the most
- difficult part of a shared memory system. In the tutorial we're
+ difficult part of a shared memory system. In the tutorial we're
just going to take a simplistic approach (eg -- busy loop) but
real-world applications will need to take a serious look at
process-level synch mechanisms such as ACE_*_Semaphore.
<P>
Caveat: I've barely begun to use shared memory
- myself. This tutorial and the next are very simple-minded and
+ myself. This tutorial and the next are very simple-minded and
primitive. Anyone who wants to provide more realistic
replacements is encouraged to drop me a note
(<A HREF="mailto:jcej@lads.com">jcej@lads.com</A>).
@@ -49,9 +50,9 @@ and using it on demand.
The server has a string of alphabets from a-z which are converted to
uppercase
by the client proving that the same memory locations are being shared
-between
+between
the two processes. The syncronisation between the server and client is
-done
+done
using the ACE_OS::sleep () instead of a semaphore/mutexes with the aim
of keeping our first dive into shared memory usage simple and easy to
fathom.
diff --git a/docs/tutorials/019/page02.html b/docs/tutorials/019/page02.html
index c9480da45ac..54af4e801f4 100644
--- a/docs/tutorials/019/page02.html
+++ b/docs/tutorials/019/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -16,7 +17,7 @@ We'll first take a look at the server side. As usual with
co-operating applications, you need the server up and running first.
In the case of shared memory applications, the server will create the
shared memory segment. In this example, it will also remove the
-segment when done. It is important to realize though that the segment
+segment when done. It is important to realize though that the segment
can be created external to your application and can persist beyond
it's lifetime. In fact, you can use shared memory to create a layer
of persistence between application instances (at least, until the
@@ -41,7 +42,7 @@ main (int, char *[])
100);
}
#else <font color=red>// ACE_LACKS_SYSV_SHMEM</font>
-int
+int
main (int, char *argv[])
{
<font color=red>/*
@@ -59,14 +60,14 @@ main (int, char *argv[])
uniquely identifies the segment and allows other apps to
attach to the same segment. Execute 'ipcs -m' before and
after starting this app to see that the segment is created.
- (I can't for the life of me correlate the SHM_KEY value back
+ (I can't for the life of me correlate the SHM_KEY value back
to the key/id reported by ipcs though.)
*/</font>
ACE_Shared_Memory_SV shm_server (SHM_KEY, SHMSZ,
<font color=#008888>ACE_Shared_Memory_SV::ACE_CREATE</font>);
<font color=red>/*
- The constructor created the segment for us but we still need
+ The constructor created the segment for us but we still need
to map the segment into our address space. (Note that you
can pass a value to malloc() but it will be silently
igored.) The void* (cast to char*) that is returned will
@@ -75,7 +76,7 @@ main (int, char *argv[])
char *shm = (char *) shm_server.malloc ();
<font color=red>/*
- Since we're asking to create the segment, we will fail if it
+ Since we're asking to create the segment, we will fail if it
already exists. We could fall back and simply attach to it
like the client but I'd rather not assume it was a previous
instance of this app that left the segment around.
@@ -83,7 +84,7 @@ main (int, char *argv[])
if (shm == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"<font color=green>%p\n\t(%P|%t) Cannot create shared memory segment.\n</font>"
- "<font color=green>\tUse 'ipcs' to see if it already exists\n</font>",
+ "<font color=green>\tUse 'ipcs' to see if it already exists\n</font>",
argv[0]),
100);
@@ -103,7 +104,7 @@ main (int, char *argv[])
shm ));
<font color=red>/*
- At this point, our application can use the pointer just like
+ At this point, our application can use the pointer just like
any other given to us by new or malloc. For our purposes,
we'll copy in the alpabet as a null-terminated string.
*/</font>
@@ -114,7 +115,7 @@ main (int, char *argv[])
<font color=red>/*
Using a simple not-too-busy loop, we'll wait for the client
- (or anyone else) to change the first byte in the shared area
+ (or anyone else) to change the first byte in the shared area
to a '*' character. This is where you would rather use
semaphores or some similar "<font color=green>resource light</font>" approach.
*/</font>
@@ -137,7 +138,7 @@ main (int, char *argv[])
the segment but leave it around for other apps, use the
close() method instead.
- The free() method may be tempting but it doesn't actually do
+ The free() method may be tempting but it doesn't actually do
anything. If your app is *really* done with the shared
memory then use either close() or remove().
*/</font>
diff --git a/docs/tutorials/019/page03.html b/docs/tutorials/019/page03.html
index e5202514c21..5b35f19c8dd 100644
--- a/docs/tutorials/019/page03.html
+++ b/docs/tutorials/019/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -12,8 +13,8 @@
<P>
<HR WIDTH="100%">
-The client app looks much like the server. We could have included the
-CREATE flag with no ill effects but note the use of close() instead of
+The client app looks much like the server. We could have included the
+CREATE flag with no ill effects but note the use of close() instead of
remove(). Picking the correct detachment method is rather important!
<HR>
<PRE>
@@ -23,7 +24,7 @@ remove(). Picking the correct detachment method is rather important!
<font color=blue>#include</font> "<font color=green>shmem.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,
@@ -31,7 +32,7 @@ main (int, char *[])
100);
}
#else <font color=red>// ACE_LACKS_SYSV_SHMEM</font>
-int
+int
main (int, char *[])
{
<font color=red>/*
@@ -45,9 +46,9 @@ main (int, char *[])
char *shm = (char *) shm_client.malloc ();
<font color=red>/*
- If the segment identified by SHM_KEY didn't exist then we'll
+ If the segment identified by SHM_KEY didn't exist then we'll
get back a 0 from malloc(). You should do this check even
- if you include the CREATE flag 'cause you never know when it
+ if you include the CREATE flag 'cause you never know when it
might fail.
*/</font>
if (shm == 0)
@@ -71,7 +72,7 @@ main (int, char *[])
putchar (*s);
*s = toupper(*s);
}
-
+
putchar ('\n');
<font color=red>/*
diff --git a/docs/tutorials/019/page04.html b/docs/tutorials/019/page04.html
index 79f00aefbb7..de471e1ac08 100644
--- a/docs/tutorials/019/page04.html
+++ b/docs/tutorials/019/page04.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%">
- Before we move on to shmem.h, I want to show a different approach. In
+ Before we move on to shmem.h, I want to show a different approach. In
this new client/server pair, I use placement new to stuff an object
(instead of a blob of bytes) into the shared memory segment.
<P>
@@ -21,7 +22,7 @@
<ul>
<li>Be sure your pointers point into the shared memory and not
local process memory.
- <li>Only in very special cases will objects with virtual methods
+ <li>Only in very special cases will objects with virtual methods
work (because of the VTable pointers).
</ul>
<P>
@@ -34,7 +35,7 @@ That's not to say you shouldn't try... Just try carefully and test a lot!
<font color=blue>#include</font> "<font color=green>shmem.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,
@@ -42,19 +43,19 @@ main (int, char *[])
100);
}
#else <font color=red>// ACE_LACKS_SYSV_SHMEM</font>
-int
+int
main (int, char *argv[])
{
<font color=red>// Be sure the segment is sized to hold our object.</font>
ACE_Shared_Memory_SV shm_server (SHM_KEY,
- sizeof (SharedData),
+ sizeof (SharedData),
<font color=#008888>ACE_Shared_Memory_SV::ACE_CREATE</font>);
char *shm = (char *) shm_server.malloc ();
if (shm == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"<font color=green>%p\n\t(%P|%t) Cannot create shared memory segment.\n</font>"
- "<font color=green>\tUse 'ipcs' to see if it already exists\n</font>",
+ "<font color=green>\tUse 'ipcs' to see if it already exists\n</font>",
argv[0]),
100);
@@ -77,7 +78,7 @@ main (int, char *argv[])
<font color=red>/*
Another cheesy busy loop while we wait for the object to
- become available. The cool way would be to hide a semaphore
+ become available. The cool way would be to hide a semaphore
or two behind this method call & eliminate the sleep.
*/</font>
while (sd->available () == 0)
@@ -103,7 +104,7 @@ main (int, char *argv[])
<font color=blue>#include</font> "<font color=green>shmem.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,
@@ -111,12 +112,12 @@ main (int, char *[])
100);
}
#else <font color=red>// ACE_LACKS_SYSV_SHMEM</font>
-int
+int
main (int, char *[])
{
ACE_Shared_Memory_SV shm_client (SHM_KEY,
sizeof (SharedData));
-
+
char *shm = (char *) shm_client.malloc ();
ACE_DEBUG ((LM_INFO,
@@ -125,7 +126,7 @@ main (int, char *[])
<font color=red>/*
More placement new. The constructor parameter prevents
- clobbering what the server may have written with it's show()
+ clobbering what the server may have written with it's show()
method.
*/</font>
SharedData *sd = new (shm) SharedData (0);
@@ -140,7 +141,7 @@ main (int, char *[])
sd->available (1);
shm_client.close ();
-
+
return 0;
}
diff --git a/docs/tutorials/019/page05.html b/docs/tutorials/019/page05.html
index 60bc8c938d4..510affb2249 100644
--- a/docs/tutorials/019/page05.html
+++ b/docs/tutorials/019/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -54,7 +55,7 @@ public:
<font color=red>// Set the value of available_</font>
void available (int not_in_use);
-
+
protected:
<font color=red>// Big enough for a simple message</font>
char buf_[128];
diff --git a/docs/tutorials/019/page06.html b/docs/tutorials/019/page06.html
index 3951e6cfd14..0dee71f02cc 100644
--- a/docs/tutorials/019/page06.html
+++ b/docs/tutorials/019/page06.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/019/server.cpp b/docs/tutorials/019/server.cpp
index e114e2c66c1..40997844ef8 100644
--- a/docs/tutorials/019/server.cpp
+++ b/docs/tutorials/019/server.cpp
@@ -16,7 +16,7 @@ main (int, char *[])
100);
}
#else // ACE_LACKS_SYSV_SHMEM
-int
+int
main (int, char *argv[])
{
/*
@@ -34,14 +34,14 @@ main (int, char *argv[])
uniquely identifies the segment and allows other apps to
attach to the same segment. Execute 'ipcs -m' before and
after starting this app to see that the segment is created.
- (I can't for the life of me correlate the SHM_KEY value back
+ (I can't for the life of me correlate the SHM_KEY value back
to the key/id reported by ipcs though.)
*/
ACE_Shared_Memory_SV shm_server (SHM_KEY, SHMSZ,
ACE_Shared_Memory_SV::ACE_CREATE);
/*
- The constructor created the segment for us but we still need
+ The constructor created the segment for us but we still need
to map the segment into our address space. (Note that you
can pass a value to malloc() but it will be silently
igored.) The void* (cast to char*) that is returned will
@@ -50,7 +50,7 @@ main (int, char *argv[])
char *shm = (char *) shm_server.malloc ();
/*
- Since we're asking to create the segment, we will fail if it
+ Since we're asking to create the segment, we will fail if it
already exists. We could fall back and simply attach to it
like the client but I'd rather not assume it was a previous
instance of this app that left the segment around.
@@ -58,7 +58,7 @@ main (int, char *argv[])
if (shm == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n\t(%P|%t) Cannot create shared memory segment.\n"
- "\tUse 'ipcs' to see if it already exists\n",
+ "\tUse 'ipcs' to see if it already exists\n",
argv[0]),
100);
@@ -78,7 +78,7 @@ main (int, char *argv[])
shm ));
/*
- At this point, our application can use the pointer just like
+ At this point, our application can use the pointer just like
any other given to us by new or malloc. For our purposes,
we'll copy in the alpabet as a null-terminated string.
*/
@@ -89,7 +89,7 @@ main (int, char *argv[])
/*
Using a simple not-too-busy loop, we'll wait for the client
- (or anyone else) to change the first byte in the shared area
+ (or anyone else) to change the first byte in the shared area
to a '*' character. This is where you would rather use
semaphores or some similar "resource light" approach.
*/
@@ -112,7 +112,7 @@ main (int, char *argv[])
the segment but leave it around for other apps, use the
close() method instead.
- The free() method may be tempting but it doesn't actually do
+ The free() method may be tempting but it doesn't actually do
anything. If your app is *really* done with the shared
memory then use either close() or remove().
*/
diff --git a/docs/tutorials/019/server2.cpp b/docs/tutorials/019/server2.cpp
index 5c54e895500..54d532d4134 100644
--- a/docs/tutorials/019/server2.cpp
+++ b/docs/tutorials/019/server2.cpp
@@ -3,7 +3,7 @@
#include "shmem.h"
#if defined (ACE_LACKS_SYSV_SHMEM)
-int
+int
main (int, char *[])
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -11,19 +11,19 @@ main (int, char *[])
100);
}
#else // ACE_LACKS_SYSV_SHMEM
-int
+int
main (int, char *argv[])
{
// Be sure the segment is sized to hold our object.
ACE_Shared_Memory_SV shm_server (SHM_KEY,
- sizeof (SharedData),
+ sizeof (SharedData),
ACE_Shared_Memory_SV::ACE_CREATE);
char *shm = (char *) shm_server.malloc ();
if (shm == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n\t(%P|%t) Cannot create shared memory segment.\n"
- "\tUse 'ipcs' to see if it already exists\n",
+ "\tUse 'ipcs' to see if it already exists\n",
argv[0]),
100);
@@ -46,7 +46,7 @@ main (int, char *argv[])
/*
Another cheesy busy loop while we wait for the object to
- become available. The cool way would be to hide a semaphore
+ become available. The cool way would be to hide a semaphore
or two behind this method call & eliminate the sleep.
*/
while (sd->available () == 0)
diff --git a/docs/tutorials/019/shmem.h b/docs/tutorials/019/shmem.h
index 68a16112f06..74d4798b794 100644
--- a/docs/tutorials/019/shmem.h
+++ b/docs/tutorials/019/shmem.h
@@ -34,7 +34,7 @@ public:
// Set the value of available_
void available (int not_in_use);
-
+
protected:
// Big enough for a simple message
char buf_[128];
diff --git a/docs/tutorials/020/client.cpp b/docs/tutorials/020/client.cpp
index 6be12920164..ba9ad43a862 100644
--- a/docs/tutorials/020/client.cpp
+++ b/docs/tutorials/020/client.cpp
@@ -10,7 +10,7 @@ int main (int, char *[])
ACE_DEBUG ((LM_INFO, "(%P|%t) Memory Mapped file is at 0x%x\n",
shm ));
-
+
if( ! shm )
{
ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t) Could not get the mmapped file!\n"),100);
@@ -21,7 +21,7 @@ int main (int, char *[])
putchar (*s);
*s = toupper(*s);
}
-
+
putchar ('\n');
*shm = '*';
diff --git a/docs/tutorials/020/client2.cpp b/docs/tutorials/020/client2.cpp
index 35ddc8ffe43..d06ffc4dbe9 100644
--- a/docs/tutorials/020/client2.cpp
+++ b/docs/tutorials/020/client2.cpp
@@ -6,7 +6,7 @@
int main (int, char *[])
{
ACE_Shared_Memory_MM shm_client (SHM_KEY, sizeof(SharedData));
-
+
char *shm = (char *) shm_client.malloc ();
ACE_DEBUG ((LM_INFO, "(%P|%t) Memory Mapped file is at 0x%x\n",
@@ -19,7 +19,7 @@ int main (int, char *[])
sd->available(1);
shm_client.close();
-
+
return 0;
}
diff --git a/docs/tutorials/020/combine.shar b/docs/tutorials/020/combine.shar
index fa330caeede..ad86e176be9 100644
--- a/docs/tutorials/020/combine.shar
+++ b/docs/tutorials/020/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:08 EST by <jcej@chiroptera.tragus.org>.
-# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/020'.
+# Made on 1999-09-21 22:49 EDT by <jcej@chiroptera.tragus.org>.
+# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/020'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -13,7 +13,7 @@
# ------ ---------- ------------------------------------------
# 426 -rw-rw-r-- hdr
# 69 -rw-rw-r-- bodies
-# 1395 -rw-rw-r-- page01.pre
+# 1396 -rw-rw-r-- page01.pre
# 524 -rw-rw-r-- page02.pre
# 115 -rw-rw-r-- page03.pre
# 411 -rw-rw-r-- page04.pre
@@ -66,7 +66,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh12949; then
+if mkdir _sh05260; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -180,12 +180,12 @@ SHAR_EOF
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page01.pre:' 'MD5 check failed'
-dce708188357c329c4d68d4799f5511b page01.pre
+8f2683c077c043b2d5fe5f6b39c506c5 page01.pre
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page01.pre'`"
- test 1395 -eq "$shar_count" ||
- $echo 'page01.pre:' 'original size' '1395,' 'current size' "$shar_count!"
+ test 1396 -eq "$shar_count" ||
+ $echo 'page01.pre:' 'original size' '1396,' 'current size' "$shar_count!"
fi
fi
# ============= page02.pre ==============
@@ -360,5 +360,5 @@ SHAR_EOF
$echo 'page02.pst:' 'original size' '132,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh12949
+rm -fr _sh05260
exit 0
diff --git a/docs/tutorials/020/mmap.h b/docs/tutorials/020/mmap.h
index f80489ff51e..1604b678ccb 100644
--- a/docs/tutorials/020/mmap.h
+++ b/docs/tutorials/020/mmap.h
@@ -24,12 +24,12 @@ class SharedData
{
public:
SharedData (int initialize = 1);
-
+
void set (void);
void show (void);
int available (void);
void available (int not_in_use);
-
+
protected:
char buf_[128];
int available_;
diff --git a/docs/tutorials/020/page01.html b/docs/tutorials/020/page01.html
index 099d0bb3725..932bbb96ada 100644
--- a/docs/tutorials/020/page01.html
+++ b/docs/tutorials/020/page01.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -19,14 +20,14 @@
persistence of memory even across reboots. I wonder if you
could memory map a file that's mounted via NFS?
<p>
- Like the shared memory tutorial, this one is also very basic and
+ Like the shared memory tutorial, this one is also very basic and
primitive. I'm assuming you've read that one, so I'll just hit
the high points this time through..
<P>
Kirthika's abstract:
<UL>
Here, the ACE_Shared_Memory_MM class has been used to provide
-persistence of the contents of the shared memory resource used by
+persistence of the contents of the shared memory resource used by
the server and client. A memory_map which is really a file mapped onto
memory appears like an array which can be
easily manipulated while actually the data is stored in a file thus
diff --git a/docs/tutorials/020/page02.html b/docs/tutorials/020/page02.html
index bb21f07d60f..456aef1ed11 100644
--- a/docs/tutorials/020/page02.html
+++ b/docs/tutorials/020/page02.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -43,7 +44,7 @@ main (int, char *[])
ACE_DEBUG ((LM_INFO, "<font color=green>(%P|%t) Memory Mapped file is at 0x%x\n</font>",
shm ));
-
+
for (char c = 'a'; c &lt;= 'z'; c++)
*s++ = c;
@@ -58,7 +59,7 @@ main (int, char *[])
}
putchar ('\n');
-
+
if (shm_server.remove () &lt; 0)
ACE_ERROR ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green>remove</font>"));
@@ -67,7 +68,7 @@ main (int, char *[])
</PRE>
<HR>
-BTW: In ACE 4.6.7 and prior there is a bug that prevents the remove()
+BTW: In ACE 4.6.7 and prior there is a bug that prevents the remove()
method from actually removing the physical file.
<P><HR WIDTH="100%">
<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page03.html">Continue This Tutorial</A>]</CENTER>
diff --git a/docs/tutorials/020/page03.html b/docs/tutorials/020/page03.html
index 9ff47b04670..179924de4cd 100644
--- a/docs/tutorials/020/page03.html
+++ b/docs/tutorials/020/page03.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -28,7 +29,7 @@ int main (int, char *[])
ACE_DEBUG ((LM_INFO, "<font color=green>(%P|%t) Memory Mapped file is at 0x%x\n</font>",
shm ));
-
+
if( ! shm )
{
ACE_ERROR_RETURN ((LM_ERROR,"<font color=green>(%P|%t) Could not get the mmapped file!\n</font>"),100);
@@ -39,7 +40,7 @@ int main (int, char *[])
putchar (*s);
*s = toupper(*s);
}
-
+
putchar ('\n');
*shm = '*';
diff --git a/docs/tutorials/020/page04.html b/docs/tutorials/020/page04.html
index 93155c27c49..c5b395eadcb 100644
--- a/docs/tutorials/020/page04.html
+++ b/docs/tutorials/020/page04.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -16,7 +17,7 @@ I wanted to show placement new again & prove that you can use it with
a memory mapped file just as easily as with a shared memory
segment.
<p>
-Imagine if you had an object that contained an image & then you mapped
+Imagine if you had an object that contained an image & then you mapped
that to a file... Instead of a bunch of jpg files laying
around, you would actually have objects instead. Save the
image? No problem, it's already there!
@@ -42,12 +43,12 @@ main (int, char *[])
sd->set();
sd->available(0);
-
+
while ( ! sd->available() )
<font color=#008888>ACE_OS::sleep</font> (1);
sd->show();
-
+
if (shm_server.remove () &lt; 0)
ACE_ERROR ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green>remove</font>"));
@@ -65,7 +66,7 @@ main (int, char *[])
int main (int, char *[])
{
ACE_Shared_Memory_MM shm_client (SHM_KEY, sizeof(SharedData));
-
+
char *shm = (char *) shm_client.malloc ();
ACE_DEBUG ((LM_INFO, "<font color=green>(%P|%t) Memory Mapped file is at 0x%x\n</font>",
@@ -78,7 +79,7 @@ int main (int, char *[])
sd->available(1);
shm_client.close();
-
+
return 0;
}
diff --git a/docs/tutorials/020/page05.html b/docs/tutorials/020/page05.html
index 612a942a061..e60beaa5158 100644
--- a/docs/tutorials/020/page05.html
+++ b/docs/tutorials/020/page05.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -43,12 +44,12 @@ class SharedData
{
public:
SharedData (int initialize = 1);
-
+
void set (void);
void show (void);
int available (void);
void available (int not_in_use);
-
+
protected:
char buf_[128];
int available_;
diff --git a/docs/tutorials/020/page06.html b/docs/tutorials/020/page06.html
index af67e7754d6..7b004ce187b 100644
--- a/docs/tutorials/020/page06.html
+++ b/docs/tutorials/020/page06.html
@@ -1,3 +1,4 @@
+<!-- $Id$ -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
diff --git a/docs/tutorials/020/server.cpp b/docs/tutorials/020/server.cpp
index 34cab1d8637..16fb4ab9230 100644
--- a/docs/tutorials/020/server.cpp
+++ b/docs/tutorials/020/server.cpp
@@ -17,7 +17,7 @@ main (int, char *[])
ACE_DEBUG ((LM_INFO, "(%P|%t) Memory Mapped file is at 0x%x\n",
shm ));
-
+
for (char c = 'a'; c <= 'z'; c++)
*s++ = c;
@@ -32,7 +32,7 @@ main (int, char *[])
}
putchar ('\n');
-
+
if (shm_server.remove () < 0)
ACE_ERROR ((LM_ERROR, "%p\n", "remove"));
diff --git a/docs/tutorials/020/server2.cpp b/docs/tutorials/020/server2.cpp
index 9b5e6b21fee..2cbfa4373a3 100644
--- a/docs/tutorials/020/server2.cpp
+++ b/docs/tutorials/020/server2.cpp
@@ -17,12 +17,12 @@ main (int, char *[])
sd->set();
sd->available(0);
-
+
while ( ! sd->available() )
ACE_OS::sleep (1);
sd->show();
-
+
if (shm_server.remove () < 0)
ACE_ERROR ((LM_ERROR, "%p\n", "remove"));
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",
diff --git a/docs/tutorials/Makefile b/docs/tutorials/Makefile
index 30ec524e40f..4a88e3b566a 100644
--- a/docs/tutorials/Makefile
+++ b/docs/tutorials/Makefile
@@ -2,7 +2,7 @@
# $Id$
all clean realclean UNSHAR SHAR HTML CLEAN : #
- for i in * ; do \
+ for i in ??? ; do \
[ -f $$i/Makefile ] || continue ; \
( cd $$i ; $(MAKE) $@ ) ; \
done