diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-01-12 00:20:30 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-01-12 00:20:30 +0000 |
commit | 41a692e96641cc0ab31afd5deae5d75e2e36b329 (patch) | |
tree | 999cac1fc0d882557cdb6ba2a7654ecbc62e7e8a | |
parent | 4bf793aa69617841e69ee668474572076320dee0 (diff) | |
download | ATCD-41a692e96641cc0ab31afd5deae5d75e2e36b329.tar.gz |
foo
-rw-r--r-- | COPYING | 19 | ||||
-rw-r--r-- | ChangeLog-97a | 80 | ||||
-rw-r--r-- | README | 238 | ||||
-rw-r--r-- | ace/ACE.cpp | 17 | ||||
-rw-r--r-- | ace/ACE.h | 4 | ||||
-rw-r--r-- | ace/Memory_Pool.cpp | 12 | ||||
-rw-r--r-- | ace/OS.i | 10 | ||||
-rw-r--r-- | ace/README | 1 | ||||
-rw-r--r-- | ace/Reactor.cpp | 4 | ||||
-rw-r--r-- | ace/Task.h | 10 | ||||
-rw-r--r-- | ace/config-irix5.2.h | 3 | ||||
-rw-r--r-- | ace/config-irix5.3-g++.h | 3 | ||||
-rw-r--r-- | ace/config-irix5.3-sgic++.h | 3 | ||||
-rw-r--r-- | ace/config-irix6.2-sgic++.h | 3 | ||||
-rw-r--r-- | ace/config-win32-msvc4.x.h | 5 | ||||
-rw-r--r-- | ace/config-winnt-4.0-msvc4.x.h | 3 | ||||
-rw-r--r-- | apps/Gateway/Gateway/Concrete_Proxy_Handlers.cpp | 16 | ||||
-rw-r--r-- | apps/Gateway/Gateway/Event_Channel.cpp | 55 | ||||
-rw-r--r-- | apps/Gateway/Gateway/Event_Channel.h | 24 | ||||
-rw-r--r-- | apps/Gateway/Gateway/Proxy_Handler.h | 2 | ||||
-rw-r--r-- | examples/ASX/Event_Server/Event_Server/Options.h | 13 | ||||
-rw-r--r-- | examples/ASX/Event_Server/Event_Server/Peer_Router.h | 6 | ||||
-rw-r--r-- | netsvcs/servers/main.cpp | 2 |
23 files changed, 253 insertions, 280 deletions
diff --git a/COPYING b/COPYING new file mode 100644 index 00000000000..a73f15d0b5a --- /dev/null +++ b/COPYING @@ -0,0 +1,19 @@ +COPYRIGHT INFORMATION FOR ACE + +ACE is copyrighted by Douglas C. Schmidt and his research group at +Washington University, Copyright (c) 1993-1997, all rights reserved. +You are free to do anything you like with the ACE source code, e.g., +including it in commercial software, as long as you include this +copyright statement along with code built using ACE. + +You are under no obligation to freely redistribute any of your source +code that is built using ACE (be aware that rpc++ is distributed under +the GNU GPL, which has a different copyright policy). Please note, +however, that you may not do anything to the ACE code that will +prevent it from being distributed freely (such as copyrighting it or +claiming authorship). Naturally, neither I nor my research group is +responsible for any problems caused by using ACE. + + Douglas C. Schmidt + schmidt@cs.wustl.edu + diff --git a/ChangeLog-97a b/ChangeLog-97a index e3a3dc1ecfd..120898a131a 100644 --- a/ChangeLog-97a +++ b/ChangeLog-97a @@ -1,9 +1,89 @@ +Sat Jan 11 15:11:28 1997 Douglas C. Schmidt <schmidt@flamenco.cs.wustl.edu> + + * ace/OS.i (thr_setprio): The POSIX implementation of + ACE_OS:thr_setprio did not set the priority. It calls: + + pthread_setschedparam( thr_id, &policy, ¶m ) + + and then does + + prio = param.sched_priority. + + instead of + + param.sched_priority = prio; + + This is now fixed. Thanks to John Bossom <John.Bossom@Cognos.COM> + for reporting this. + + * ace/config-irix*.h: Modified all the IRIX config files to + use the new ACE_HAS_GETPAGESIZE feature since this is necessary + to differentiate between IRIX and IRIX64. + Thanks to Fred LaBar <flabar@fallschurch.esys.com> for + reporting this. + + * ace/ACE.cpp: Modified the round_to_pagesize() so that if + a config.h file enables ACE_HAS_GETPAGESIZE then we use + that function in preference to the value in config.h. + Thanks to Fred LaBar <flabar@fallschurch.esys.com> for + suggesting this. + + * ace/ACE.cpp: Modified the round_to_pagesize() so that on + platforms that allow the page size to be obtained dynamically + we'll get that rather than replying on what it set in the + config.h file. We'll cache this value in a static variable + to speedup searches. Thanks to James Mansion for suggesting + this. + + * apps/Gateway/Gateway: Finished adding support for thread-safe + reference counting to the uses of ACE_Message_Block. + + * examples/ASX/Event_Server/Event_Server/Peer_Router.cpp: Replaced + the use of ACE_MT_SYNCH with ACE_SYNCH so that this will compile + correctly on non-MT platforms. + +Fri Jan 10 12:38:42 1997 Douglas C. Schmidt <schmidt@flamenco.cs.wustl.edu> + + * Added a COPYING file that explicitly states the copyright status + of ACE. + + * ace/config-win32-msvc4.x.h and ace/config-winnt-4.0-msvc4.x.h: + By default, we'll revert to *not* enabling + ACE_HAS_TEMPLATE_TYPEDEFS for MSVC++ 4.2, even though this is + well-support by the compiler since it breaks some application + code that expects to use 3 template parameters for + ACE_Svc_Handler<>. The "fix" is to use the ACE_SOCK_STREAM + macros (rather than using the "ACE_SOCK_Stream, ACE_INET_Addr" + tuple) in order to achieve portability in either case. Thanks + to Karlheinz for pointing out the need for backwards + compatibility. + Wed Jan 8 01:00:05 1997 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> * tests/Message_Block_Test.cpp: Enhanced the torture test of the ACE_Message_Block so that it stresses the reference counting implementation in a multi-threaded environment. +Wed Jan 08 10:26:45 1997 David L. Levine <levine@cs.wustl.edu> + + * ace/Message_Block.cpp (~ACE_Data_Block): assigned 0 to + allocator_strategry_ after deleting it; fixed template + specializations (for g++) by using macros instead of class names; + commented out template specializations because Service_Record.cpp + already has them, and they should only appear once in the library + in order to avoid link clashes + + * ace/Service_Object.cpp (ACE_Service_Object): reordered + initializations in constructor + + * ace/Service_Record.cpp (ACE_Service_Record): reordered + initializations in constructor + + * ace/config-linux-lxpthreads.h: added + ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS, thanks to + James CE Johnson <jcej@lads.com> for tracking down this + problem and testing the fix. + Tue Jan 7 13:03:25 1997 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> * ace/Message_Block: Continued to improve the @@ -218,6 +218,7 @@ Many of the C++ wrappers and higher-level components have been described in issues of the C++ Report, as well as in proceedings of the following journals, conferences, and workshops: + . The OOPSLA '96 conference in San Jose, CA, October 1996 . 4th IEEE International Conference on Software Reuse in Orlando, Florida, April 1996. . The SIGS OOP conference in Munich, Germany, February, 1996 @@ -240,208 +241,21 @@ the following journals, conferences, and workshops: . The 2nd SIGS C++ World conference, October, 1993 . IEE Distributed Systems Engineering Journal, December 1994. -A collection of white papers and tutorial handouts are included with -the release. The documentation is stored in the ACE-documentation -directory on wuarchive.wustl.edu (approximately 4 meg compressed). - -This directory contains postscript versions of various papers that -describe different aspects of ACE. You might want to read SUG-94.ps -first, since it gives an overview of the toolkit. - -Document Published in or presented at --------- ---------------------------- -Acceptor-Connector.ps "Acceptor and Connector: Design Patterns for - Actively and Passively Initializing Network - Services." Presented at the EuroPLoP - workshop held in conjunction with the ECOOP - '95 conference, August 1995 - -ACE-concurrency.ps "An OO Encapsulation of Lightweight OS - Concurrency Mechanisms in the ACE Toolkit." - Washington University technical report WUCS-95-31. - -ACT.ps "Asynchronous Completion Token" submitted to - the ``3rd Pattern Languages of Programs - conference,'' Allerton Park, Illinois, - September, 1996. - -Active-Objects.ps "Active Object: an Object Behavioral Pattern - for Concurrent Programming," the proceedings - of the Pattern Languages of Programs Conference, - September 1995 - -Atomic_Op-94.ps "Transparently Parameterizing Synchronization - into a Concurrent Distributed Application", - C++ Report, July/August 1994 - -C++-report-col1.ps C++ Report Object Interconnections Column 1 -C++-report-col2.ps C++ Report Object Interconnections Column 2 -C++-report-col3.ps C++ Report Object Interconnections Column 3 -C++-report-col4.ps C++ Report Object Interconnections Column 4 -C++-report-col5.ps C++ Report Object Interconnections Column 5 -C++-report-col6.ps C++ Report Object Interconnections Column 6 -C++-report-col7.ps C++ Report Object Interconnections Column 7 - -C++-USENIX-94.ps "ASX: an Object-Oriented Framework for - Developing Distributed Applications," 6th - USENIX C++ Conference, April 1994 - -C++-world-93.ps "An Object-Oriented Framework for Developing - Network Server Daemons", 2nd C++ World - conference, Dallas, Texas, October 1993 - -C++-wrappers.ps "Systems Programming with C++ Wrappers: - Encapsulating Interprocess Communication - Services with Object-Oriented Interfaces", C++ - Report, September/October 1992 - -CACM-95.ps "Experience Using Design Patterns to Develop - Reuseable Object-Oriented Communication - Software," Communications of the ACM, Special - Issue on Object-Oriented Experiences, Vol. 38, - No. 10, October, 1995. - -COOTS-95.ps "Object-Oriented Components for High-speed - Network Programming," 1st USENIX Conference on - Object-Oriented Technologies, April 1995. - -COOTS-96.ps "Design and Performance of an Object-Oriented - Framework for Electronic Medical Imaging," - 2nd USENIX Conference on Object-Oriented - Technologies, June 1996. - -Connector.ps "A Design Pattern for Actively Initializing Network - Services," C++ Report, January 1996 - -daemon-design-94.ps "A Domain Analysis of Network Daemon Design - Dimensions", C++ Report, March/April 1994 - -DC-Locking.ps Double-Checked Locking, submitted to the ``3rd - Pattern Languages of Programs conference,'' - Allerton Park, Illinois, September, 1996. - -ECOOP-95.ps "Experiences Using Design Patterns to Evolve - System Software Across Diverse OS Platforms," - ECOOP '95 conference, August 1995 - -External-Polymorphism.ps "External Polymorphism: an Object Structural - Pattern for Transparently Extending Concrete - Data Types," submitted to the ``3rd Pattern - Languages of Programs conference,'' - Allerton Park, Illinois, September, 1996. - -EuroPLoP.ps Acceptor and Connector, Design Patterns for - Initializing Communication Services, - 1st European Conference on Pattern Languages - of Programs, Kloster Irsee, July, 1996. - -IPC_SAP-92.ps "IPC_SAP: An Object-Oriented Interface to - Interprocess Communication Services" C++ - Report, November/December 1992 - -JPDC-96.ps "The Performance of Alternative Threading - Architectures for Parallel Communication - Subsystems", Submitted to the Journal - of Parallel and Distributed Computing. - -PLoP-94.ps "Reactor: An Object Behavioral Pattern for - Concurrent Event Demultiplexing and Event - Handler Dispatching," Pattern Languages of - Programs Conference, August 1994 - -PLoP-95.ps "Half-Sync/Half-Async: A Pattern for Efficient - and Well-structured Concurrent I/O Systems." - Pattern Languages of Programs Conference, - September 1995 - -Reactor1-93.ps "The Reactor: An Object-Oriented Interface for - Event-Driven UNIX I/O Multiplexing (Part 1 of - 2)" C++ Report, February 1993 - -Reactor2-93.ps "The Object-Oriented Design and Implementation - of the Reactor: A C++ Wrapper for UNIX I/O - Multiplexing (Part 2 of 2)" C++ Report, - September/October 1993 - -IWCDS.ps "The Service Configurator Framework: An - Extensible Architecture for Dynamically - Configuring Concurrent, Multi-Service Network - Daemons", 2nd IEEE International Workshop on - Configurable Distributed Systems, March 1994 - -Service-Configurator.ps "Service Configurator," submitted to the ``3rd - Pattern Languages of Programs conference,'' - Allerton Park, Illinois, September, 1996. - -SIGCOMM-95.ps "AITPM: a Strategy for Integrating IP - with ATM," SIGCOMM '95, August, 1995. - -SIGCOMM-96.ps "Measuring the Performance of Communication - Middleware on High-Speed Networks," SIGCOMM - '96, August, 1996. - -SUG-94.ps "The ADAPTIVE Communication Environment: - An Object-Oriented Network Programming Toolkit - for Developing Communication Software", - 11th and 12th Sun Users Group Conference, - December 1993 and June 1994 - -TAPOS-95.ps "A System of Reusable Design Patterns for - Communication Software," The - Journal of Theory and Practice of Object - Systems Special Issue on Patterns and Pattern - Languages - -TSS-pattern.ps "Thread-Specific Storage: A Pattern for - Reducing Locking Overhead in Concurrent - Programs," submitted to the ``3rd Pattern - Languages of Programs conference,'' - Allerton Park, Illinois, September, 1996. +A collection of white papers and tutorial handouts are included at +ftp://wuarchive.wustl.edu/languages/c++/ACE/ACE-documentation. This +directory contains postscript versions of various papers that describe +different aspects of ACE. The documentation is approximately 6 meg +compressed. I update these papers periodically to reflect changes to the ACE architecture. Therefore, you might want to check the date on the files to make sure that you have read the most recent versions of these papers. -ACE TUTORIALS - -I update these papers periodically to reflect changes to the ACE -architecture. Therefore, you might want to check the date on the -files to make sure that you have read the most recent versions of -these papers. - -There may not be enough space on this ftp server to store the -following tutorial handouts: - -OOCP-tutorial4.ps SIGS Object Expo, June 1995. - SIGS OOP '95 conference, February, 1995; - USENIX Winter Conference, January 1995; - -OONP-tutorial4.ps ECOOP conference, August 1995 - USENIX Conference on Object-Oriented Technologies, - June 1995; - 3rd SIGS C++ World conference, November, 1994; - 9th ACM OOPSLA conference, October 1994; - 6th USENIX C++ Conference, April 1994; - 2nd SIGS C++ World conference, October 1993; - -CORBA4.ps "Measuring the Performance of Object-Oriented - Components for High-speed Network Programming," - Object Expo, June 1995; - USENIX Conference on Object-Oriented - Technologies, June 1995 - HP Labs, June 1995 - -corba4.ps "An Overview of CORBA" - Washington University Distributed Operating - Systems class - -These handouts are available via WWW at URL: +This material is also available available via the WWW at URL: http://www.cs.wustl.edu/~schmidt/ -as at wuarchive.wustl.edu in the directory /languages/c++/ACE. - BUILDING AND INSTALLING ACE Please refer to the INSTALL file for information on how to build and @@ -457,7 +271,7 @@ platforms) using Sun C++ 4.x and GNU G++ 2.7.x. The release has also been ported to SCO UNIX, HP-UX, SGI, OSF/1, AIX, Linux, Windows NT and Windows '95. I expect that major portions of the release will port easily to other platforms. If you can help port ACE to other -platforms I'd appreciate it. +platforms I'd appreciate it. ACE MAILING LIST @@ -465,32 +279,6 @@ A mailing list is available for discussing bug fixes, enhancements, and porting issues regarding ACE. Please send mail to me at the ace-users-request@cs.wustl.edu if you'd like to join the mailing list. -COPYRIGHT INFORMATION FOR ACE - -ACE is copyrighted Douglas C. Schmidt and his research group at -Washington University. You are free to do anything you like with the -ACE source code such as including it in commercial software, as long -as you include this copyright statement along with code built using -ACE. - -You are under no obligation to freely redistribute any of your source -code that is built using ACE (be aware that rpc++ is distributed under -the GNU GPL, which has a different copyright policy). Please note, -however, that you may not do anything to the ACE code that will -prevent it from being distributed freely (such as copyrighting it). -Naturally, neither I nor my research group is responsible for any -problems caused by using ACE. - -My goal is to see ACE continue to evolve and become a more -comprehensive, robust, and well-documented C++ class library that is -freely available to researchers and developers. If you have any -improvements, suggestions, and or comments, I'd like to hear about it. - - Thanks, - - Douglas C. Schmidt - schmidt@cs.wustl.edu - ACKNOWLEDGEMENTS ACE has been deeply influenced and improved by the following members @@ -675,6 +463,7 @@ Samuel_Bercovici <Samuel_Bercovici_at_EFT__AD2@mail.icomverse.com> Per Andersson <Per.Andersson@hfera.ericsson.se> Anthony McConnell <Tonym@datel.demon.co.uk> Mark Rabotnikov <mark@usp.elscintcorp.co.il> +John Bossom <John.Bossom@Cognos.COM> I would particularly like to thank Paul Stephenson, who worked with me at Ericsson and is now at ObjectSpace. Paul devised the recursive @@ -686,3 +475,12 @@ Finally, I'd also like to thank Todd L. Montgomery <tmont@cerc.wvu.edu>, fellow heavy metal head, for fulfilling his quest to get ACE to compile with GCC! +In conclusion, my goal is to see ACE continue to evolve and become a +more comprehensive, robust, and well-documented C++ class library that +is freely available to researchers and developers. If you have any +improvements, suggestions, and or comments, I'd like to hear about it. + + Thanks, + + Douglas C. Schmidt + schmidt@cs.wustl.edu diff --git a/ace/ACE.cpp b/ace/ACE.cpp index d2527bee293..f2cc0b206e4 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -9,6 +9,9 @@ #include "ace/Thread_Manager.h" #include "ace/Reactor.h" +// Size of a VM page. +size_t ACE::pagesize_ = ACE_PAGE_SIZE; + int ACE::register_stdin_handler (ACE_Event_Handler *eh, ACE_Reactor *reactor, @@ -622,7 +625,19 @@ size_t ACE::round_to_pagesize (off_t len) { ACE_TRACE ("ACE::round_to_pagesize"); - return (len + (ACE_PAGE_SIZE - 1)) & ~(ACE_PAGE_SIZE - 1); + + if (ACE::pagesize_ == 0) + { +#if defined (ACE_WIN32) + SYSTEM_INFO sys_info; + ::GetSystemInfo (&sys_info); + ACE::pagesize_ = (size_t) sys_info.dwPageSize; +#elif defined (ACE_HAS_GETPAGESIZE) + ACE::pagesize_ = (size_t) ::getpagesize (); +#endif /* ACE_WIN32 */ + } + + return (len + (ACE::pagesize_ - 1)) & ~(ACE_::pagesize_ - 1); } ACE_HANDLE diff --git a/ace/ACE.h b/ace/ACE.h index 1916a743276..136bec61d21 100644 --- a/ace/ACE.h +++ b/ace/ACE.h @@ -335,6 +335,10 @@ public: private: ACE (void); // Ensure we can't define an instance of this class... + + static size_t pagesize_; + // Size of a VM page. + }; #include "ace/ACE.i" diff --git a/ace/Memory_Pool.cpp b/ace/Memory_Pool.cpp index 22acf5d3809..b43dde52c85 100644 --- a/ace/Memory_Pool.cpp +++ b/ace/Memory_Pool.cpp @@ -138,7 +138,7 @@ ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool (LPCTSTR backing_store_name, // memory. int ACE_MMAP_Memory_Pool::commit_backing_store_name (size_t rounded_bytes, - off_t &file_offset) + off_t &file_offset) { ACE_TRACE ("ACE_MMAP_Memory_Pool::commit_backing_store_name"); @@ -209,7 +209,8 @@ ACE_MMAP_Memory_Pool::acquire (size_t nbytes, off_t file_offset; - if (this->commit_backing_store_name (rounded_bytes, file_offset) == -1) + if (this->commit_backing_store_name (rounded_bytes, + file_offset) == -1) return 0; if (this->map_file (file_offset) == -1) @@ -417,8 +418,7 @@ ACE_Shared_Memory_Pool::in_use (off_t &offset, shmid_ds buf; for (counter = 0; - counter < this->max_segments_ - && st[counter].used_ == 1; + counter < this->max_segments_ && st[counter].used_ == 1; counter++) { if (ACE_OS::shmctl (st[counter].shmid_, IPC_STAT, &buf) == -1) @@ -448,8 +448,8 @@ ACE_Shared_Memory_Pool::commit_backing_store_name (size_t rounded_bytes, else { int shmid = ACE_OS::shmget (st[counter].key_, - rounded_bytes, - this->file_perms_ | IPC_CREAT | IPC_EXCL); + rounded_bytes, + this->file_perms_ | IPC_CREAT | IPC_EXCL); if (shmid == -1) ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) %p\n", "shmget"), 0); @@ -3278,7 +3278,9 @@ ACE_OS::thr_getprio (ACE_hthread_t thr_id, int &prio) int result; int policy = 0; - ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_getschedparam (thr_id, &policy, ¶m), result), int, -1, result); + ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_getschedparam (thr_id, &policy, ¶m), + result), int, + -1, result); prio = param.sched_priority; return result; #elif defined (ACE_HAS_WTHREADS) @@ -3767,8 +3769,10 @@ ACE_OS::thr_setprio (ACE_hthread_t thr_id, int prio) int result; int policy = 0; - ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_setschedparam (thr_id, &policy, ¶m), result), int, -1, result); - prio = param.sched_priority; + param.sched_priority = prio; + ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pthread_setschedparam (thr_id, &policy, ¶m), + result), int, + -1, result); return result; ACE_NOTSUP_RETURN (-1); #elif defined (ACE_HAS_WTHREADS) diff --git a/ace/README b/ace/README index e08ed010e38..d2c9b5cba2c 100644 --- a/ace/README +++ b/ace/README @@ -32,6 +32,7 @@ ACE_HAS_COMPLEX_LOCK Platform supports non-standard readers/writer locks... ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES Prototypes for both signal() and struct sigaction are consistent. ACE_HAS_CPLUSPLUS_HEADERS Compiler/platform has correctly prototyped header files ACE_HAS_DLL Build ACE using the frigging PC DLL nonsense... +ACE_HAS_GETPAGESIZE Platform supports getpagesize() call. ACE_HAS_GETRUSAGE Platform supports the getrusage() system call. ACE_HAS_GNU_CSTRING_H Denotes that GNU has cstring.h as standard which redefines memchr() ACE_HAS_GREENHILLS_SOCKETS Platform is using GreenHills compiler with its weird socket headers. diff --git a/ace/Reactor.cpp b/ace/Reactor.cpp index c1a0f6721ad..814b82f35e7 100644 --- a/ace/Reactor.cpp +++ b/ace/Reactor.cpp @@ -685,8 +685,8 @@ ACE_Reactor::notify (ACE_Event_Handler *eh, n = this->notify_handler_.notify (eh, mask, timeout); #else - ACE_UNUSED_ARGS (eh); - ACE_UNUSED_ARGS (mask); + ACE_UNUSED_ARG (eh); + ACE_UNUSED_ARG (mask); #endif /* ACE_MT_SAFE */ return n == -1 ? -1 : 0; } diff --git a/ace/Task.h b/ace/Task.h index dec495683b6..bfa6b552b5b 100644 --- a/ace/Task.h +++ b/ace/Task.h @@ -166,14 +166,14 @@ class ACE_Export ACE_Task_Exit // = TITLE // Keep exit information for a Task in thread specific storage so // that the Task::close() method will get called no matter how - // the thread exits (e.g., via Thread::exit() or by "falling off - // the end of Task::svc_run"). + // the thread exits (e.g., via <Thread::exit>, C++ or Win32 + // exception, "falling off the end" of <Task::svc_run>, etc.). // // = DESCRIPTION // This clever little helper class is stored in thread-specific - // storage using the ACE_TSS wrapper. When a thread - // exits the ACE_TSS::cleanup() function calls - // "delete" on this object, thereby closing it down gracefully. + // storage using the <ACE_TSS> wrapper. When a thread exits the + // <ACE_TSS::cleanup> function deletes this object, thereby + // closing it down gracefully. { public: ACE_Task_Exit (void); diff --git a/ace/config-irix5.2.h b/ace/config-irix5.2.h index 3b729019f05..847c4153d05 100644 --- a/ace/config-irix5.2.h +++ b/ace/config-irix5.2.h @@ -13,6 +13,9 @@ // it). //#define ACE_HAS_STREAM_PIPES +// Platform supports getpagesize() call. +#define ACE_HAS_GETPAGESIZE + #define ACE_HAS_SIGWAIT // Platform supports System V IPC (most versions of UNIX, but not Win32) diff --git a/ace/config-irix5.3-g++.h b/ace/config-irix5.3-g++.h index 7c23f36a848..f194c849043 100644 --- a/ace/config-irix5.3-g++.h +++ b/ace/config-irix5.3-g++.h @@ -7,6 +7,9 @@ #if !defined (ACE_CONFIG_H) #define ACE_CONFIG_H +// Platform supports getpagesize() call. +#define ACE_HAS_GETPAGESIZE + #define IRIX5 #define ACE_HAS_SIGWAIT diff --git a/ace/config-irix5.3-sgic++.h b/ace/config-irix5.3-sgic++.h index 2a4781e320e..bb142c8a692 100644 --- a/ace/config-irix5.3-sgic++.h +++ b/ace/config-irix5.3-sgic++.h @@ -10,6 +10,9 @@ #define IRIX5 +// Platform supports getpagesize() call. +#define ACE_HAS_GETPAGESIZE + #define ACE_NEEDS_SYSTIME_H #define ACE_HAS_SIGWAIT diff --git a/ace/config-irix6.2-sgic++.h b/ace/config-irix6.2-sgic++.h index 47076738861..c4b5ef02c19 100644 --- a/ace/config-irix6.2-sgic++.h +++ b/ace/config-irix6.2-sgic++.h @@ -24,6 +24,9 @@ // ACE supports threads. #define ACE_HAS_THREADS +// Platform supports getpagesize() call. +#define ACE_HAS_GETPAGESIZE + //Sockets may be called in multi-threaded programs #define ACE_HAS_MT_SAFE_SOCKETS diff --git a/ace/config-win32-msvc4.x.h b/ace/config-win32-msvc4.x.h index 433f23d0e0f..e20a33a96e0 100644 --- a/ace/config-win32-msvc4.x.h +++ b/ace/config-win32-msvc4.x.h @@ -110,7 +110,10 @@ // #define ACE_HAS_ORBIX // #define ACE_HAS_MT_ORBIX -#define ACE_HAS_TEMPLATE_TYPEDEFS +// Uncomment the following line if you want to use template typedefs, +// which are well-supported with MSVC++ 4.2. +// #define ACE_HAS_TEMPLATE_TYPEDEFS + #define ACE_LACKS_SBRK #define ACE_LACKS_UTSNAME_T #define ACE_LACKS_SEMBUF_T diff --git a/ace/config-winnt-4.0-msvc4.x.h b/ace/config-winnt-4.0-msvc4.x.h index 97625039c60..fef3e1a6d83 100644 --- a/ace/config-winnt-4.0-msvc4.x.h +++ b/ace/config-winnt-4.0-msvc4.x.h @@ -109,7 +109,10 @@ // #define ACE_HAS_ORBIX // #define ACE_HAS_MT_ORBIX +// Uncomment the following line if you want to use template typedefs, +// which are well-supported with MSVC++ 4.2. #define ACE_HAS_TEMPLATE_TYPEDEFS + #define ACE_LACKS_SBRK #define ACE_LACKS_UTSNAME_T #define ACE_LACKS_SEMBUF_T diff --git a/apps/Gateway/Gateway/Concrete_Proxy_Handlers.cpp b/apps/Gateway/Gateway/Concrete_Proxy_Handlers.cpp index e250dccf173..7f5c1d9ab6c 100644 --- a/apps/Gateway/Gateway/Concrete_Proxy_Handlers.cpp +++ b/apps/Gateway/Gateway/Concrete_Proxy_Handlers.cpp @@ -205,7 +205,12 @@ Supplier_Proxy::recv (ACE_Message_Block *&forward_addr) if (this->msg_frag_ == 0) // No existing fragment... ACE_NEW_RETURN (this->msg_frag_, - ACE_Message_Block (sizeof (Event)), + ACE_Message_Block (sizeof (Event), + ACE_Message_Block::MB_DATA, + 0, + 0, + 0, + this->event_channel_.options ().locking_strategy_), -1); Event *event = (Event *) this->msg_frag_->rd_ptr (); @@ -311,7 +316,10 @@ Supplier_Proxy::recv (ACE_Message_Block *&forward_addr) // portion onto its continuation field. forward_addr = new ACE_Message_Block (sizeof (Event_Key), ACE_Message_Block::MB_PROTO, - this->msg_frag_); + this->msg_frag_, + 0, + 0, + this->event_channel_.options ().locking_strategy_); if (forward_addr == 0) { this->msg_frag_ = this->msg_frag_->release (); @@ -441,7 +449,7 @@ Thr_Consumer_Proxy::open (void *) // Reactivate message queue. If it was active then this is the // first time in and we need to spawn a thread, otherwise the queue // was inactive due to some problem and we've already got a thread. - else if (this->msg_queue ()->activate () == ACE_Message_Queue<ACE_MT_SYNCH>::WAS_ACTIVE) + else if (this->msg_queue ()->activate () == ACE_Message_Queue<ACE_SYNCH>::WAS_ACTIVE) { ACE_DEBUG ((LM_DEBUG, "(%t) spawning new thread\n")); // Become an active object by spawning a new thread to transmit @@ -534,7 +542,7 @@ Thr_Supplier_Proxy::open (void *) // Reactivate message queue. If it was active then this is the // first time in and we need to spawn a thread, otherwise the queue // was inactive due to some problem and we've already got a thread. - else if (this->msg_queue ()->activate () == ACE_Message_Queue<ACE_MT_SYNCH>::WAS_ACTIVE) + else if (this->msg_queue ()->activate () == ACE_Message_Queue<ACE_SYNCH>::WAS_ACTIVE) { ACE_DEBUG ((LM_DEBUG, "(%t) spawning new thread\n")); // Become an active object by spawning a new thread to transmit diff --git a/apps/Gateway/Gateway/Event_Channel.cpp b/apps/Gateway/Gateway/Event_Channel.cpp index 6b1337ffab2..954fd8f2e26 100644 --- a/apps/Gateway/Gateway/Event_Channel.cpp +++ b/apps/Gateway/Gateway/Event_Channel.cpp @@ -6,7 +6,8 @@ #include "Event_Channel.h" ACE_Event_Channel_Options::ACE_Event_Channel_Options (void) - : performance_window_ (0), + : locking_strategy_ (0), + performance_window_ (0), blocking_semantics_ (ACE_NONBLOCK), socket_queue_size_ (0), threading_strategy_ (REACTIVE), @@ -16,14 +17,17 @@ ACE_Event_Channel_Options::ACE_Event_Channel_Options (void) { } +ACE_Event_Channel_Options::~ACE_Event_Channel_Options (void) +{ + delete this->locking_strategy_; +} + ACE_Event_Channel::~ACE_Event_Channel (void) { - delete this->lock_adapter_; } ACE_Event_Channel::ACE_Event_Channel (void) - : lock_adapter_ (0), - acceptor_ (*this) + : acceptor_ (*this) { } @@ -33,12 +37,6 @@ ACE_Event_Channel::options (void) return this->options_; } -ACE_Lock * -ACE_Event_Channel::message_block_locking_strategy (void) -{ - return this->lock_adapter_; -} - int ACE_Event_Channel::compute_performance_statistics (void) { @@ -104,8 +102,11 @@ ACE_Event_Channel::compute_performance_statistics (void) ACE_ERROR_RETURN ((LM_ERROR, "(%t) %p\n", "resume_all"), -1); ACE_DEBUG ((LM_DEBUG, "(%t) resuming all threads...")); } + + return 0; } +int ACE_Event_Channel::handle_timeout (const ACE_Time_Value &, const void *) { @@ -115,6 +116,7 @@ ACE_Event_Channel::handle_timeout (const ACE_Time_Value &, // This method forwards the <event> to Consumer that have registered // to receive it. +int ACE_Event_Channel::put (ACE_Message_Block *event, ACE_Time_Value *) { @@ -191,6 +193,7 @@ ACE_Event_Channel::put (ACE_Message_Block *event, return 0; } +int ACE_Event_Channel::svc (void) { return 0; @@ -234,6 +237,7 @@ ACE_Event_Channel::complete_proxy_connection (Proxy_Handler *proxy_handler) ACE_ERROR_RETURN ((LM_ERROR, "(%t) %p\n", n == 0 ? "peer has closed down unexpectedly" : "send"), -1); + return 0; } // Restart connection (blocking_semantics dicates whether we restart @@ -308,6 +312,7 @@ ACE_Event_Channel::initiate_acceptor (void) // This method gracefully shuts down all the Handlers in the // Proxy_Handler Connection Map. +int ACE_Event_Channel::close (u_long) { if (this->options ().threading_strategy_ != ACE_Event_Channel_Options::REACTIVE) @@ -351,7 +356,9 @@ ACE_Event_Channel::find_proxy (ACE_INT32 proxy_id, int ACE_Event_Channel::bind_proxy (Proxy_Handler *proxy_handler) { - switch (this->proxy_map_.bind (proxy_handler->id (), proxy_handler)) + int result = this->proxy_map_.bind (proxy_handler->id (), proxy_handler); + + switch (result) { case -1: ACE_ERROR_RETURN ((LM_ERROR, @@ -366,6 +373,10 @@ ACE_Event_Channel::bind_proxy (Proxy_Handler *proxy_handler) case 0: // Success. return 0; + default: + ACE_ERROR_RETURN ((LM_DEBUG, + "(%t) invalid result %d\n", result), -1); + /* NOTREACHED */ } } @@ -373,23 +384,32 @@ int ACE_Event_Channel::subscribe (const Event_Key &event_addr, Consumer_Dispatch_Set *cds) { + int result = this->efd_.bind (event_addr, cds); + // Bind with consumer map, keyed by peer address. - switch (this->efd_.bind (event_addr, cds)) + switch (result) { case -1: - ACE_ERROR_RETURN ((LM_ERROR, "(%t) bind failed for connection %d\n", + ACE_ERROR_RETURN ((LM_ERROR, + "(%t) bind failed for connection %d\n", event_addr.proxy_id_), -1); /* NOTREACHED */ case 1: // Oops, found a duplicate! - ACE_ERROR_RETURN ((LM_DEBUG, "(%t) duplicate consumer map entry %d, " + ACE_ERROR_RETURN ((LM_DEBUG, + "(%t) duplicate consumer map entry %d, " "already bound\n", event_addr.proxy_id_), -1); /* NOTREACHED */ case 0: // Success. return 0; + default: + ACE_ERROR_RETURN ((LM_DEBUG, + "(%t) invalid result %d\n", result), -1); + /* NOTREACHED */ } } +int ACE_Event_Channel::open (void *) { // Ignore SIPPIPE so each Consumer_Proxy can handle it. @@ -406,9 +426,10 @@ ACE_Event_Channel::open (void *) // If we're not running reactively, then we need to make sure that // <ACE_Message_Block> reference counting operations are // thread-safe. Therefore, we create an <ACE_Lock_Adapter> that is - // parameterized by <ACE_Thread_Mutex> to prevent race conditions. + // parameterized by <REF_COUNT_MUTEX> to prevent race conditions. if (this->options ().threading_strategy_ != ACE_Event_Channel_Options::REACTIVE) - ACE_NEW_RETURN (this->lock_adapter_, ACE_Lock_Adapter<ACE_Thread_Mutex>, -1); - + ACE_NEW_RETURN (this->options ().locking_strategy_, + ACE_Lock_Adapter<REF_COUNT_MUTEX>, + -1); return 0; } diff --git a/apps/Gateway/Gateway/Event_Channel.h b/apps/Gateway/Gateway/Event_Channel.h index 0baaac64c81..22dd8137147 100644 --- a/apps/Gateway/Gateway/Event_Channel.h +++ b/apps/Gateway/Gateway/Event_Channel.h @@ -22,6 +22,12 @@ #include "Consumer_Dispatch_Set.h" #include "Event_Forwarding_Discriminator.h" +#if defined (ACE_HAS_THREADS) +typedef ACE_Thread_Mutex REF_COUNT_MUTEX; +#else +typedef ACE_Null_Mutex REF_COUNT_MUTEX; +#endif /* ACE_HAS_THREADS */ + typedef ACE_Null_Mutex MAP_MUTEX; class ACE_Svc_Export ACE_Event_Channel_Options @@ -32,6 +38,15 @@ public: ACE_Event_Channel_Options (void); // Initialization. + ~ACE_Event_Channel_Options (void); + // Termination. + + ACE_Lock_Adapter<REF_COUNT_MUTEX> *locking_strategy_; + // Points to the locking strategy used for serializing access to the + // reference count in <ACE_Message_Block>. If it's 0, then there's + // no locking strategy and we're using a REACTIVE concurrency + // strategy. + int performance_window_; // Number of seconds after connection establishment to report // throughput. @@ -62,7 +77,7 @@ public: // Enabled if we are playing the role of the Connector. }; -class ACE_Svc_Export ACE_Event_Channel : public ACE_Task<ACE_MT_SYNCH> +class ACE_Svc_Export ACE_Event_Channel : public ACE_Task<ACE_SYNCH> // = TITLE // Define a generic Event_Channel. // @@ -130,13 +145,6 @@ private: // Periodically callback to perform timer-based performance // profiling. - ACE_Lock *message_block_locking_strategy (void); - // The strategy for locking <ACE_Message_Block> reference counting. - // This is NULL if our threading strategy is REACTIVE, else it - // points to the ACE_Lock_Adapter<ACE_Thread_Mutex> defined below. - - ACE_Lock_Adapter<ACE_Thread_Mutex> *lock_adapter_; - Proxy_Handler_Connector connector_; // Used to establish the connections actively. diff --git a/apps/Gateway/Gateway/Proxy_Handler.h b/apps/Gateway/Gateway/Proxy_Handler.h index e75795bd340..e7e32a5d182 100644 --- a/apps/Gateway/Gateway/Proxy_Handler.h +++ b/apps/Gateway/Gateway/Proxy_Handler.h @@ -26,7 +26,7 @@ // Forward declaration. class ACE_Event_Channel; -class Proxy_Handler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_MT_SYNCH> +class Proxy_Handler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_SYNCH> // = TITLE // Proxy_Handler contains info about connection state and addressing. // diff --git a/examples/ASX/Event_Server/Event_Server/Options.h b/examples/ASX/Event_Server/Event_Server/Options.h index 596b2b48cc3..98d36bd8d43 100644 --- a/examples/ASX/Event_Server/Event_Server/Options.h +++ b/examples/ASX/Event_Server/Event_Server/Options.h @@ -1,17 +1,15 @@ /* -*- C++ -*- */ // $Id$ -/* Option manager for Event Server */ - -#if !defined (DEVICE_OPTIONS_H) -#define DEVICE_OPTIONS_H +#if !defined (OPTIONS_H) +#define OPTIONS_H #include "ace/OS.h" #include "ace/Profile_Timer.h" -#if defined (ACE_HAS_THREADS) - class Options + // = TITLE + // Option Singleton for Event Server. { public: static Options *instance (void); @@ -98,5 +96,4 @@ private: }; #include "Options.i" -#endif /* ACE_HAS_THREADS */ -#endif /* DEVICE_OPTIONS_H */ +#endif /* OPTIONS_H */ diff --git a/examples/ASX/Event_Server/Event_Server/Peer_Router.h b/examples/ASX/Event_Server/Event_Server/Peer_Router.h index 32d7e85906d..e0cb2d8340a 100644 --- a/examples/ASX/Event_Server/Event_Server/Peer_Router.h +++ b/examples/ASX/Event_Server/Event_Server/Peer_Router.h @@ -15,7 +15,7 @@ typedef ACE_HANDLE ROUTING_KEY; class Peer_Router; class Peer_Router_Context; -class Peer_Handler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_MT_SYNCH> +class Peer_Handler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_SYNCH> // = TITLE // Receive input from a Peer and forward to the appropriate // <Peer_Router>. @@ -92,7 +92,7 @@ private: // Private to ensure dynamic allocation. }; -class Peer_Router : public ACE_Task<ACE_MT_SYNCH> +class Peer_Router : public ACE_Task<ACE_SYNCH> // = TITLE // This abstract base class provides mechanisms for routing // messages to/from a ACE_Stream from/to one or more peers (which @@ -113,7 +113,7 @@ protected: Peer_Router_Context *context (void) const; // Returns the routing context. - typedef ACE_Task<ACE_MT_SYNCH> inherited; + typedef ACE_Task<ACE_SYNCH> inherited; // Helpful typedef. private: diff --git a/netsvcs/servers/main.cpp b/netsvcs/servers/main.cpp index 5cd9150f744..de967698218 100644 --- a/netsvcs/servers/main.cpp +++ b/netsvcs/servers/main.cpp @@ -39,7 +39,7 @@ main (int argc, char *argv[]) // Register ourselves to receive SIGINT and SIGQUIT so we can shut // down gracefully via signals. if (ACE_Service_Config::reactor ()->register_handler (sig_set, &sa) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", -1)); + ACE_ERROR_RETURN ((LM_ERROR, "%p\n"), -1); // Try to link in the svc.conf entries dynamically. if (daemon.open (argc, argv) == -1) |