complement-svn Mailing List for Complement (Page 22)
Status: Pre-Alpha
Brought to you by:
complement
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(61) |
Nov
(76) |
Dec
(39) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(33) |
Feb
(41) |
Mar
(16) |
Apr
|
May
(22) |
Jun
(14) |
Jul
(64) |
Aug
(60) |
Sep
(35) |
Oct
(34) |
Nov
(10) |
Dec
(5) |
2008 |
Jan
(4) |
Feb
(24) |
Mar
(10) |
Apr
(30) |
May
(15) |
Jun
(50) |
Jul
(20) |
Aug
(7) |
Sep
(8) |
Oct
(10) |
Nov
|
Dec
|
From: <com...@us...> - 2006-12-14 08:26:46
|
Revision: 1453 http://svn.sourceforge.net/complement/?rev=1453&view=rev Author: complement Date: 2006-12-14 00:26:44 -0800 (Thu, 14 Dec 2006) Log Message: ----------- established better test order; test for fork added Modified Paths: -------------- trunk/complement/explore/test/mt/Makefile.inc trunk/complement/explore/test/mt/unit_test.cc Added Paths: ----------- trunk/complement/explore/test/mt/mt_test.cc trunk/complement/explore/test/mt/mt_test.h trunk/complement/explore/test/mt/mt_test_suite.cc trunk/complement/explore/test/mt/mt_test_suite.h Modified: trunk/complement/explore/test/mt/Makefile.inc =================================================================== --- trunk/complement/explore/test/mt/Makefile.inc 2006-12-14 07:27:44 UTC (rev 1452) +++ trunk/complement/explore/test/mt/Makefile.inc 2006-12-14 08:26:44 UTC (rev 1453) @@ -1,6 +1,6 @@ -# -*- makefile -*- Time-stamp: <04/05/06 18:40:56 ptr> -# $Id$ +# -*- makefile -*- Time-stamp: <06/12/14 11:11:10 ptr> PRGNAME = mt_ut SRC_CC = unit_test.cc timespec.cc mutex_test.cc spinlock_test.cc \ - recursive_mutex.cc join.cc signal-1.cc signal-2.cc flck.cc lfs.cc + recursive_mutex.cc join.cc signal-1.cc signal-2.cc flck.cc lfs.cc \ + mt_test.cc mt_test_suite.cc Added: trunk/complement/explore/test/mt/mt_test.cc =================================================================== --- trunk/complement/explore/test/mt/mt_test.cc (rev 0) +++ trunk/complement/explore/test/mt/mt_test.cc 2006-12-14 08:26:44 UTC (rev 1453) @@ -0,0 +1,77 @@ +// -*- C++ -*- Time-stamp: <06/12/14 11:10:26 ptr> + +/* + * Copyright (c) 2006 + * Petr Ovtchenkov + * + * Licensed under the Academic Free License Version 3.0 + * + */ + +#include <boost/test/unit_test.hpp> + +#include "mt_test.h" + +#include <mt/xmt.h> + +#include <sys/shm.h> +#include <sys/wait.h> + +#include <signal.h> + +using namespace boost::unit_test_framework; + +void mt_test::fork() +{ + shmid_ds ds; + int id = shmget( 5000, 1024, IPC_CREAT | IPC_EXCL | 0600 ); + BOOST_REQUIRE( id != -1 ); + // if ( id == -1 ) { + // cerr << "Error on shmget" << endl; + // } + BOOST_REQUIRE( shmctl( id, IPC_STAT, &ds ) != -1 ); + // if ( shmctl( id, IPC_STAT, &ds ) == -1 ) { + // cerr << "Error on shmctl" << endl; + // } + void *buf = shmat( id, 0, 0 ); + BOOST_REQUIRE( buf != reinterpret_cast<void *>(-1) ); + // if ( buf == reinterpret_cast<void *>(-1) ) { + // cerr << "Error on shmat" << endl; + // } + + xmt::__Condition<true>& fcnd = *new( buf ) xmt::__Condition<true>(); + fcnd.set( false ); + + try { + xmt::Thread::fork(); + + try { + + // Child code + + } + catch ( ... ) { + } + + exit( 0 ); + } + catch ( xmt::fork_in_parent& child ) { + try { + BOOST_CHECK( child.pid() > 0 ); + + fcnd.set( true ); + + int stat; + BOOST_CHECK( waitpid( child.pid(), &stat, 0 ) == child.pid() ); + } + catch ( ... ) { + } + } + catch ( ... ) { + } + + (&fcnd)->~__Condition<true>(); + + shmdt( buf ); + shmctl( id, IPC_RMID, &ds ); +} Added: trunk/complement/explore/test/mt/mt_test.h =================================================================== --- trunk/complement/explore/test/mt/mt_test.h (rev 0) +++ trunk/complement/explore/test/mt/mt_test.h 2006-12-14 08:26:44 UTC (rev 1453) @@ -0,0 +1,19 @@ +// -*- C++ -*- Time-stamp: <06/12/14 10:45:35 ptr> + +/* + * Copyright (c) 2006 + * Petr Ovtchenkov + * + * Licensed under the Academic Free License Version 3.0 + * + */ + +#ifndef __MT_TEST_H +#define __MT_TEST_H + +struct mt_test +{ + void fork(); +}; + +#endif // __MT_TEST_H Added: trunk/complement/explore/test/mt/mt_test_suite.cc =================================================================== --- trunk/complement/explore/test/mt/mt_test_suite.cc (rev 0) +++ trunk/complement/explore/test/mt/mt_test_suite.cc 2006-12-14 08:26:44 UTC (rev 1453) @@ -0,0 +1,26 @@ +// -*- C++ -*- Time-stamp: <06/12/14 11:12:02 ptr> + +/* + * Copyright (c) 2006 + * Petr Ovtchenkov + * + * Licensed under the Academic Free License Version 3.0 + * + */ + +#include "mt_test_suite.h" +#include "mt_test.h" + +using namespace boost::unit_test_framework; + +mt_test_suite::mt_test_suite() : + test_suite( "mt test suite" ) +{ + boost::shared_ptr<mt_test> instance( new mt_test() ); + + test_case *fork_tc = BOOST_CLASS_TEST_CASE( &mt_test::fork, instance ); + + // basic2_tc->depends_on( basic1_tc ); + + add( fork_tc ); +}; Added: trunk/complement/explore/test/mt/mt_test_suite.h =================================================================== --- trunk/complement/explore/test/mt/mt_test_suite.h (rev 0) +++ trunk/complement/explore/test/mt/mt_test_suite.h 2006-12-14 08:26:44 UTC (rev 1453) @@ -0,0 +1,22 @@ +// -*- C++ -*- Time-stamp: <06/12/14 10:42:18 ptr> + +/* + * Copyright (c) 2006 + * Petr Ovtchenkov + * + * Licensed under the Academic Free License Version 3.0 + * + */ + +#ifndef __MT_TEST_SUITE_H +#define __MT_TEST_SUITE_H + +#include <boost/test/unit_test.hpp> + +struct mt_test_suite : + public boost::unit_test_framework::test_suite +{ + mt_test_suite(); +}; + +#endif // __MT_TEST_SUITE_H Modified: trunk/complement/explore/test/mt/unit_test.cc =================================================================== --- trunk/complement/explore/test/mt/unit_test.cc 2006-12-14 07:27:44 UTC (rev 1452) +++ trunk/complement/explore/test/mt/unit_test.cc 2006-12-14 08:26:44 UTC (rev 1453) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/14 10:01:14 ptr> +// -*- C++ -*- Time-stamp: <06/12/14 10:47:39 ptr> /* * Copyright (c) 2002, 2003, 2004, 2006 @@ -11,6 +11,8 @@ #include <boost/test/unit_test.hpp> #include <config/feature.h> +#include "mt_test_suite.h" + using namespace boost::unit_test_framework; void timespec_diff(); @@ -25,6 +27,7 @@ void flock_test(); void lfs_test(); + #ifdef WIN32 test_suite *__cdecl init_unit_test_suite( int argc, char * * const argv ) #else @@ -50,5 +53,7 @@ // ts->add( BOOST_TEST_CASE( &flock_test ) ); // ts->add( BOOST_TEST_CASE( &lfs_test ) ); + ts->add( new mt_test_suite() ); + return ts; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-14 07:27:45
|
Revision: 1452 http://svn.sourceforge.net/complement/?rev=1452&view=rev Author: complement Date: 2006-12-13 23:27:44 -0800 (Wed, 13 Dec 2006) Log Message: ----------- move stem Modified Paths: -------------- trunk/complement/explore/test/stem/Makefile trunk/complement/explore/test/stem/dl/Makefile Added Paths: ----------- trunk/complement/explore/test/stem/ Removed Paths: ------------- trunk/complement/explore/test/libstem/ Copied: trunk/complement/explore/test/stem (from rev 1448, trunk/complement/explore/test/libstem/unit) Modified: trunk/complement/explore/test/stem/Makefile =================================================================== --- trunk/complement/explore/test/libstem/unit/Makefile 2006-12-13 18:32:33 UTC (rev 1448) +++ trunk/complement/explore/test/stem/Makefile 2006-12-14 07:27:44 UTC (rev 1452) @@ -1,6 +1,6 @@ # -*- Makefile -*- Time-stamp: <06/12/13 01:07:22 ptr> -SRCROOT := ../../.. +SRCROOT := ../.. COMPILER_NAME := gcc EXTRA_POST := dl Modified: trunk/complement/explore/test/stem/dl/Makefile =================================================================== --- trunk/complement/explore/test/libstem/unit/dl/Makefile 2006-12-13 18:32:33 UTC (rev 1448) +++ trunk/complement/explore/test/stem/dl/Makefile 2006-12-14 07:27:44 UTC (rev 1452) @@ -1,6 +1,6 @@ # -*- Makefile -*- Time-stamp: <06/08/04 12:09:33 ptr> -SRCROOT := ../../../.. +SRCROOT := ../../.. COMPILER_NAME := gcc include Makefile.inc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-14 07:18:12
|
Revision: 1451 http://svn.sourceforge.net/complement/?rev=1451&view=rev Author: complement Date: 2006-12-13 23:18:11 -0800 (Wed, 13 Dec 2006) Log Message: ----------- move sockios Modified Paths: -------------- trunk/complement/explore/test/sockios/Makefile Added Paths: ----------- trunk/complement/explore/test/sockios/ Removed Paths: ------------- trunk/complement/explore/test/libsockios/ Copied: trunk/complement/explore/test/sockios (from rev 1448, trunk/complement/explore/test/libsockios/unit) Modified: trunk/complement/explore/test/sockios/Makefile =================================================================== --- trunk/complement/explore/test/libsockios/unit/Makefile 2006-12-13 18:32:33 UTC (rev 1448) +++ trunk/complement/explore/test/sockios/Makefile 2006-12-14 07:18:11 UTC (rev 1451) @@ -1,6 +1,6 @@ # -*- Makefile -*- Time-stamp: <03/08/15 12:46:45 ptr> -SRCROOT := ../../.. +SRCROOT := ../.. COMPILER_NAME := gcc include Makefile.inc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-14 07:07:30
|
Revision: 1450 http://svn.sourceforge.net/complement/?rev=1450&view=rev Author: complement Date: 2006-12-13 23:07:29 -0800 (Wed, 13 Dec 2006) Log Message: ----------- move mt unit tests Modified Paths: -------------- trunk/complement/explore/test/mt/Makefile trunk/complement/explore/test/mt/unit_test.cc Added Paths: ----------- trunk/complement/explore/test/mt/ Removed Paths: ------------- trunk/complement/explore/test/libmt/delay/ trunk/complement/explore/test/libmt/join/ trunk/complement/explore/test/libmt/signal-1/ trunk/complement/explore/test/libmt/signal-2/ trunk/complement/explore/test/libmt/unit/ Copied: trunk/complement/explore/test/mt (from rev 1448, trunk/complement/explore/test/libmt/unit) Modified: trunk/complement/explore/test/mt/Makefile =================================================================== --- trunk/complement/explore/test/libmt/unit/Makefile 2006-12-13 18:32:33 UTC (rev 1448) +++ trunk/complement/explore/test/mt/Makefile 2006-12-14 07:07:29 UTC (rev 1450) @@ -1,6 +1,6 @@ # -*- Makefile -*- Time-stamp: <06/08/04 10:54:19 ptr> -SRCROOT := ../../.. +SRCROOT := ../.. COMPILER_NAME := gcc include Makefile.inc Modified: trunk/complement/explore/test/mt/unit_test.cc =================================================================== --- trunk/complement/explore/test/libmt/unit/unit_test.cc 2006-12-13 18:32:33 UTC (rev 1448) +++ trunk/complement/explore/test/mt/unit_test.cc 2006-12-14 07:07:29 UTC (rev 1450) @@ -1,30 +1,13 @@ -// -*- C++ -*- Time-stamp: <04/08/31 23:07:30 ptr> +// -*- C++ -*- Time-stamp: <06/12/14 10:01:14 ptr> /* - * - * Copyright (c) 2002, 2003, 2004 + * Copyright (c) 2002, 2003, 2004, 2006 * Petr Ovtchenkov * - * Licensed under the Academic Free License Version 2.0 + * Licensed under the Academic Free License Version 3.0 * - * This material is provided "as is", with absolutely no warranty expressed - * or implied. Any use is at your own risk. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. */ -#ifdef __unix -# ifdef __HP_aCC -#pragma VERSIONID "@(#)$Id$" -# else -#ident "@(#)$Id$" -# endif -#endif - #include <boost/test/unit_test.hpp> #include <config/feature.h> @@ -62,8 +45,10 @@ // (stack saved/restored, that confuse stack unwind); // by this reason next test is commented: // ts->add( BOOST_TEST_CASE( &signal_2_test ) ); - ts->add( BOOST_TEST_CASE( &flock_test ) ); - ts->add( BOOST_TEST_CASE( &lfs_test ) ); + // flock requre revision, commented now. + // ts->add( BOOST_TEST_CASE( &flock_test ) ); + // ts->add( BOOST_TEST_CASE( &lfs_test ) ); + return ts; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-13 22:03:13
|
Revision: 1449 http://svn.sourceforge.net/complement/?rev=1449&view=rev Author: complement Date: 2006-12-13 14:03:09 -0800 (Wed, 13 Dec 2006) Log Message: ----------- snapshot 2006-12-14 Added Paths: ----------- tags/complement-20061214/ Copied: tags/complement-20061214 (from rev 1448, trunk/complement) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-13 18:32:47
|
Revision: 1448 http://svn.sourceforge.net/complement/?rev=1448&view=rev Author: complement Date: 2006-12-13 10:32:33 -0800 (Wed, 13 Dec 2006) Log Message: ----------- NetTransportMgr should have own sockstream and avoid problems with order of destruction of net member. Modified Paths: -------------- trunk/complement/explore/include/stem/NetTransport.h trunk/complement/explore/lib/stem/ChangeLog trunk/complement/explore/lib/stem/NetTransport.cc Modified: trunk/complement/explore/include/stem/NetTransport.h =================================================================== --- trunk/complement/explore/include/stem/NetTransport.h 2006-12-13 18:29:16 UTC (rev 1447) +++ trunk/complement/explore/include/stem/NetTransport.h 2006-12-13 18:32:33 UTC (rev 1448) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/11/27 17:22:33 ptr> +// -*- C++ -*- Time-stamp: <06/12/13 13:22:52 ptr> /* * Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 @@ -86,7 +86,7 @@ public: NetTransportMgr() : NetTransport_base( "stem::NetTransportMgr" ) - { } + { net = &_channel; } __FIT_DECLSPEC ~NetTransportMgr(); @@ -102,6 +102,7 @@ protected: static xmt::Thread::ret_code _loop( void * ); xmt::Thread _thr; + std::sockstream _channel; }; class NetTransportMP : Modified: trunk/complement/explore/lib/stem/ChangeLog =================================================================== --- trunk/complement/explore/lib/stem/ChangeLog 2006-12-13 18:29:16 UTC (rev 1447) +++ trunk/complement/explore/lib/stem/ChangeLog 2006-12-13 18:32:33 UTC (rev 1448) @@ -1,3 +1,9 @@ +2006-12-13 Petr Ovtchenkov <pt...@is...> + + * NetTransport.h, NetTransport.cc: NetTransportMgr + should have own sockstream and avoid problems with + order of destruction of net member. + 2006-12-04 Petr Ovtchenkov <pt...@is...> * EvManager.h, EvManager.cc, Names.cc: remove global Modified: trunk/complement/explore/lib/stem/NetTransport.cc =================================================================== --- trunk/complement/explore/lib/stem/NetTransport.cc 2006-12-13 18:29:16 UTC (rev 1447) +++ trunk/complement/explore/lib/stem/NetTransport.cc 2006-12-13 18:32:33 UTC (rev 1448) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/11/30 22:46:53 ptr> +// -*- C++ -*- Time-stamp: <06/12/13 13:38:28 ptr> /* * @@ -99,7 +99,6 @@ if ( net != 0 ) { manager()->Remove( this ); net->close(); - net = 0; } } @@ -282,15 +281,7 @@ __FIT_DECLSPEC NetTransportMgr::~NetTransportMgr() { - if ( net ) { - net->rdbuf()->shutdown( sock_base::stop_in | sock_base::stop_out ); - net->close(); // otherwise _loop may not exited - // this->close(); - join(); - // NetTransport_base::close() called during loop thread termination (see _loop) - delete net; - net = 0; - } + NetTransportMgr::close(); } __FIT_DECLSPEC @@ -301,18 +292,13 @@ // I should be sure, that not more then one _loop running from here! // For this, I enforce close connection before I try open new, // and wait thread with _loop before start new. - if ( net == 0 ) { - net = new sockstream( hostname, port, stype ); - } else if ( net->is_open() ) { - // net->close(); + if ( _channel.is_open() ) { close(); // I should wait termination of _loop, clear EDS address mapping, etc. - net->open( hostname, port, stype ); - } else { - join(); // This is safe: transparent if no _loop, and wait it if one exist - net->open( hostname, port, stype ); } + join(); // This is safe: transparent if no _loop, and wait it if one exist + _channel.open( hostname, port, stype ); - if ( net->good() ) { + if ( _channel.good() ) { Event ev( EV_STEM_TRANSPORT ); gaddr_type dst; gaddr_type src; @@ -357,15 +343,10 @@ __FIT_DECLSPEC void NetTransportMgr::close() { - if ( net ) { - net->rdbuf()->shutdown( sock_base::stop_in | sock_base::stop_out ); - net->close(); // otherwise _loop may not exited - // this->close(); - join(); - // NetTransport_base::close() called during loop thread termination (see _loop) - delete net; - net = 0; - } + _channel.rdbuf()->shutdown( sock_base::stop_in | sock_base::stop_out ); + NetTransport_base::close(); + // _channel.close(); + join(); } xmt::Thread::ret_code NetTransportMgr::_loop( void *p ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-13 18:29:22
|
Revision: 1447 http://svn.sourceforge.net/complement/?rev=1447&view=rev Author: complement Date: 2006-12-13 10:29:16 -0800 (Wed, 13 Dec 2006) Log Message: ----------- container now single owner of _Connect objects; call close() and destructor of Connect instance incapsulated into _Connect Modified Paths: -------------- trunk/complement/explore/include/sockios/sockmgr.cc trunk/complement/explore/include/sockios/sockmgr.h trunk/complement/explore/lib/sockios/ChangeLog Modified: trunk/complement/explore/include/sockios/sockmgr.cc =================================================================== --- trunk/complement/explore/include/sockios/sockmgr.cc 2006-12-13 18:25:00 UTC (rev 1446) +++ trunk/complement/explore/include/sockios/sockmgr.cc 2006-12-13 18:29:16 UTC (rev 1447) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/11/29 18:43:21 ptr> +// -*- C++ -*- Time-stamp: <06/12/13 18:07:06 ptr> /* * Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 @@ -96,6 +96,9 @@ typename iterator_traits<typename _fd_sequence::iterator>::difference_type d; for ( _fd_sequence::iterator j = _pfd.begin() + 2; j != _pfd.end(); ++j ) { // _pfd at least 2 in size + // if ( j->fd == -1 ) { + // cerr << __FILE__ << ":" << __LINE__ << endl; + // } if ( j->revents != 0 ) { // We should distinguish closed socket from income message typename container_type::iterator i = @@ -108,23 +111,22 @@ d = j - _pfd.begin(); _pfd.erase( j ); j = _pfd.begin() + (d - 1); - for ( i = _M_c.begin(); i != _M_c.end(); ++i ) { - if ( (*i)->s->rdbuf()->fd() == -1 ) { - (*i)->s->close(); - (*i)->_proc->close(); - delete (*i)->_proc; - (*i)->_proc = 0; - } + i = _M_c.begin(); + while ( (i = find_if( i, _M_c.end(), bind2nd( _M_comp, -1 ) )) != _M_c.end() ) { + _dlock.lock(); + std::remove( _conn_pool.begin(), _conn_pool.end(), i ); + _dlock.unlock(); + _M_c.erase( i++ ); } } else if ( j->revents & POLLERR /* | POLLHUP | POLLNVAL */ ) { // poll first see closed socket d = j - _pfd.begin(); _pfd.erase( j ); j = _pfd.begin() + (d - 1); - (*i)->s->close(); - (*i)->_proc->close(); - delete (*i)->_proc; - (*i)->_proc = 0; + _dlock.lock(); + std::remove( _conn_pool.begin(), _conn_pool.end(), i ); + _dlock.unlock(); + _M_c.erase( i ); } else { // Check that other side close socket: // on Linux and (?) Solaris I see normal POLLIN event, and see error @@ -138,13 +140,13 @@ d = j - _pfd.begin(); _pfd.erase( j ); j = _pfd.begin() + (d - 1); - (*i)->s->close(); - (*i)->_proc->close(); - delete (*i)->_proc; - (*i)->_proc = 0; + _dlock.lock(); + std::remove( _conn_pool.begin(), _conn_pool.end(), i ); + _dlock.unlock(); + _M_c.erase( i ); } else { // normal data available for reading _dlock.lock(); - _conn_pool.push_back( *i ); + _conn_pool.push_back( i ); // xmt::Thread::gettime( &_tpush ); _pool_cnd.set( true ); _observer_cnd.set( true ); @@ -215,38 +217,17 @@ try { _Connect *cl_new; - typename container_type::iterator i = - find_if( _M_c.begin(), _M_c.end(), bind2nd( _M_comp, -1 ) ); - - if ( i == _M_c.end() ) { // we need new message processor - cl_new = new _Connect(); - cl_new->s = new sockstream(); - cl_new->s->open( _sd, addr.any ); - cl_new->_proc = new Connect( *cl_new->s ); - _M_c.push_back( cl_new ); - if ( cl_new->s->rdbuf()->in_avail() > 0 ) { - // this is the case when user read from sockstream - // in ctor above; push processing of this stream - MT_REENTRANT( _dlock, _1 ); - _conn_pool.push_back( cl_new ); - _pool_cnd.set( true ); - _observer_cnd.set( true ); - _in_buf = true; - } - } else { // we can reuse old - cl_new = *i; - cl_new->s->open( _sd, addr.any ); - // delete cl_new->_proc; // may be new ( cl_new->_proc ) Connect( *cl_new->s ); - cl_new->_proc = new Connect( *cl_new->s ); - if ( cl_new->s->rdbuf()->in_avail() > 0 ) { - // this is the case when user read from sockstream - // in ctor above; push processing of this stream - MT_REENTRANT( _dlock, _1 ); - _conn_pool.push_back( cl_new ); - _pool_cnd.set( true ); - _observer_cnd.set( true ); - _in_buf = true; - } + _M_c.push_back( _Connect() ); + _M_c.back().open( _sd, addr.any ); + cl_new = &_M_c.back(); + if ( cl_new->s.rdbuf()->in_avail() > 0 ) { + // this is the case when user read from sockstream + // in ctor above; push processing of this stream + MT_REENTRANT( _dlock, _1 ); + _conn_pool.push_back( --_M_c.end() ); + _pool_cnd.set( true ); + _observer_cnd.set( true ); + _in_buf = true; } pollfd newfd; @@ -276,6 +257,7 @@ template <class Connect> bool sockmgr_stream_MP<Connect>::accept_udp() { +#if 0 if ( !is_open() ) { return false; } @@ -295,8 +277,8 @@ typename container_type::iterator i = _M_c.begin(); sockbuf *b; while ( i != _M_c.end() ) { - b = (*i)->s->rdbuf(); - if ( (*i)->s->is_open() && b->stype() == sock_base::sock_dgram && + b = (*i).s.rdbuf(); + if ( (*i).s.is_open() && b->stype() == sock_base::sock_dgram && b->port() == addr.inet.sin_port && b->inet_addr() == addr.inet.sin_addr.s_addr ) { _c_lock.unlock(); @@ -305,9 +287,8 @@ ++i; } - cl = new _Connect(); - cl->s = new sockstream(); - _M_c.push_back( cl ); + _M_c.push_back( Connect() ); + cl->s->open( dup( fd() ), addr.any, sock_base::sock_dgram ); cl->_proc = new Connect( *cl->s ); _c_lock.unlock(); @@ -316,6 +297,7 @@ _c_lock.unlock(); cl = 0; } +#endif return true /* cl */; } @@ -361,57 +343,39 @@ } } catch ( ... ) { - me->_c_lock.lock(); - - for ( typename container_type::iterator i = me->_M_c.begin(); i != me->_M_c.end(); ++i ) { - if ( (*i)->s->is_open() ) { // close all not closed yet - (*i)->s->close(); - (*i)->_proc->close(); - } - delete (*i)->s; - (*i)->s = 0; - delete (*i)->_proc; - (*i)->_proc = 0; - } - ::close( me->_cfd ); - ::close( me->_pfd[1].fd ); - me->close(); - me->_c_lock.unlock(); - rtc.iword = -1; - me->_dlock.lock(); me->_follow = false; me->_pool_cnd.set( true, true ); me->_observer_cnd.set( true ); me->_dlock.unlock(); + // me->_c_lock.lock(); + ::close( me->_cfd ); + ::close( me->_pfd[1].fd ); + me->close(); + // me->_c_lock.unlock(); + rtc.iword = -1; + + me->mgr.join(); + return rtc; // throw; } - me->_c_lock.lock(); - - for ( typename container_type::iterator i = me->_M_c.begin(); i != me->_M_c.end(); ++i ) { - if ( (*i)->s->is_open() ) { // close all not closed yet - (*i)->s->close(); - (*i)->_proc->close(); - } - delete (*i)->s; - (*i)->s = 0; - delete (*i)->_proc; - (*i)->_proc = 0; - } - ::close( me->_cfd ); - ::close( me->_pfd[1].fd ); - me->close(); - me->_c_lock.unlock(); - me->_dlock.lock(); me->_follow = false; me->_pool_cnd.set( true, true ); me->_observer_cnd.set( true ); me->_dlock.unlock(); + // me->_c_lock.lock(); + ::close( me->_cfd ); + ::close( me->_pfd[1].fd ); + me->close(); + // me->_c_lock.unlock(); + + me->mgr.join(); + return rtc; } @@ -423,30 +387,27 @@ rtc.iword = 0; try { - sockstream *stream; timespec idle( me->_idle ); int idle_count = 0; me->_dlock.lock(); - _Connect *c = 0; + typename _Sequence::iterator c; + bool _non_empty = false; if ( me->_conn_pool.size() != 0 ) { c = me->_conn_pool.front(); me->_conn_pool.pop_front(); + _non_empty = true; xmt::Thread::gettime( &me->_tpop ); } me->_dlock.unlock(); do { - if ( c != 0 ) { - stream = c->s; - if ( stream->is_open() ) { - c->_proc->connect( *stream ); - if ( c->s == 0 || !stream->good() ) { - if ( c->_proc != 0 ) { - c->_proc->close(); - } - } else if ( stream->is_open() ) { - if ( stream->rdbuf()->in_avail() > 0 ) { + if (_non_empty ) { + sockstream& stream = c->s; + if ( stream.is_open() ) { + c->_proc->connect( stream ); + if ( stream.is_open() && stream.good() ) { + if ( stream.rdbuf()->in_avail() > 0 ) { // socket has buffered data, push it back to queue MT_REENTRANT( me->_dlock, _1 ); me->_conn_pool.push_back( c ); @@ -454,15 +415,15 @@ me->_pool_cnd.set( true ); // xmt::Thread::gettime( &me->_tpush ); } else { // no buffered data, return socket to poll - sock_base::socket_type rfd = stream->rdbuf()->fd(); + sock_base::socket_type rfd = stream.rdbuf()->fd(); ::write( me->_cfd, reinterpret_cast<const char *>(&rfd), sizeof(sock_base::socket_type) ); } - } else if ( c->_proc ) { - c->_proc->close(); } } } + _non_empty = false; + for ( idle_count = 0; idle_count < 2; ++idle_count ) { { MT_REENTRANT( me->_dlock, _1 ); @@ -472,6 +433,7 @@ if ( me->_conn_pool.size() != 0 ) { c = me->_conn_pool.front(); me->_conn_pool.pop_front(); + _non_empty = true; xmt::Thread::gettime( &me->_tpop ); break; } Modified: trunk/complement/explore/include/sockios/sockmgr.h =================================================================== --- trunk/complement/explore/include/sockios/sockmgr.h 2006-12-13 18:25:00 UTC (rev 1446) +++ trunk/complement/explore/include/sockios/sockmgr.h 2006-12-13 18:29:16 UTC (rev 1447) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/11/27 17:13:22 ptr> +// -*- C++ -*- Time-stamp: <06/12/13 17:38:44 ptr> /* * Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 @@ -145,8 +145,8 @@ _busylimit.tv_nsec = 90000000; // i.e 0.09 sec _alarm.tv_sec = 0; _alarm.tv_nsec = 50000000; // i.e 0.05 sec - _idle.tv_sec = 300; - _idle.tv_nsec = 0; // i.e 5 min + _idle.tv_sec = 10; + _idle.tv_nsec = 0; // i.e 10 sec } explicit sockmgr_stream_MP( const in_addr& addr, int port, sock_base::stype t = sock_base::sock_stream ) : @@ -158,8 +158,8 @@ _busylimit.tv_nsec = 90000000; // i.e 0.09 sec _alarm.tv_sec = 0; _alarm.tv_nsec = 50000000; // i.e 0.05 sec - _idle.tv_sec = 300; - _idle.tv_nsec = 0; // i.e 5 min + _idle.tv_sec = 10; + _idle.tv_nsec = 0; // i.e 10 sec } explicit sockmgr_stream_MP( unsigned long addr, int port, sock_base::stype t = sock_base::sock_stream ) : @@ -171,8 +171,8 @@ _busylimit.tv_nsec = 90000000; // i.e 0.09 sec _alarm.tv_sec = 0; _alarm.tv_nsec = 50000000; // i.e 0.05 sec - _idle.tv_sec = 300; - _idle.tv_nsec = 0; // i.e 5 min + _idle.tv_sec = 10; + _idle.tv_nsec = 0; // i.e 10 sec } explicit sockmgr_stream_MP( int port, sock_base::stype t = sock_base::sock_stream ) : @@ -184,8 +184,8 @@ _busylimit.tv_nsec = 50000000; // i.e 0.05 sec _alarm.tv_sec = 0; _alarm.tv_nsec = 50000000; // i.e 0.05 sec - _idle.tv_sec = 300; - _idle.tv_nsec = 0; // i.e 5 min + _idle.tv_sec = 10; + _idle.tv_nsec = 0; // i.e 10 sec } ~sockmgr_stream_MP() @@ -218,13 +218,29 @@ protected: - struct _Connect { - sockstream *s; + struct _Connect + { + _Connect() : + _proc( 0 ) + { } + + _Connect( const _Connect& ) : + _proc( 0 ) + { } + + ~_Connect() + { if ( _proc ) { s.close(); _proc->close(); } delete _proc; } + + void open( sock_base::socket_type st, const sockaddr& addr ) + { s.open( st, addr ); _proc = new Connect( s ); } + + sockstream s; Connect *_proc; }; typedef std::vector<pollfd> _fd_sequence; - typedef std::deque<_Connect *> _connect_pool_sequence; + typedef std::list<_Connect> _Sequence; + typedef std::deque<typename _Sequence::iterator> _connect_pool_sequence; void _open( sock_base::stype t = sock_base::sock_stream ); static xmt::Thread::ret_code loop( void * ); @@ -232,10 +248,10 @@ static xmt::Thread::ret_code observer( void * ); struct fd_equal : - public std::binary_function<_Connect *,int,bool> + public std::binary_function<_Connect,int,bool> { - bool operator()(const _Connect *__x, int __y) const - { return __x->s->rdbuf()->fd() == __y; } + bool operator()(const _Connect& __x, int __y) const + { return __x.s.rdbuf()->fd() == __y; } }; struct pfd_equal : @@ -262,7 +278,6 @@ protected: typedef sockmgr_stream_MP<Connect> _Self_type; - typedef std::vector<_Connect *> _Sequence; typedef fd_equal _Compare; typedef typename _Sequence::value_type value_type; typedef typename _Sequence::size_type size_type; @@ -274,7 +289,7 @@ _Sequence _M_c; _Compare _M_comp; pfd_equal _pfdcomp; - xmt::Mutex _c_lock; + // xmt::Mutex _c_lock; _fd_sequence _pfd; int _cfd; // sock_base::socket_type Modified: trunk/complement/explore/lib/sockios/ChangeLog =================================================================== --- trunk/complement/explore/lib/sockios/ChangeLog 2006-12-13 18:25:00 UTC (rev 1446) +++ trunk/complement/explore/lib/sockios/ChangeLog 2006-12-13 18:29:16 UTC (rev 1447) @@ -1,3 +1,9 @@ +2006-12-13 Petr Ovtchenkov <pt...@is...> + + * sockmgr.h, sockmgr.cc: container now single owner + of _Connect objects; call close() and destructor of + Connect instance incapsulated into _Connect; + 2006-11-29 Petr Ovtchenkov <pt...@is...> * sockmgr.cc: don't delete objects via _conn_pool This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-13 18:25:07
|
Revision: 1446 http://svn.sourceforge.net/complement/?rev=1446&view=rev Author: complement Date: 2006-12-13 10:25:00 -0800 (Wed, 13 Dec 2006) Log Message: ----------- add join method Modified Paths: -------------- trunk/complement/explore/include/mt/thr_mgr.h trunk/complement/explore/lib/mt/ChangeLog trunk/complement/explore/lib/mt/thr_mgr.cc Modified: trunk/complement/explore/include/mt/thr_mgr.h =================================================================== --- trunk/complement/explore/include/mt/thr_mgr.h 2006-12-13 09:43:33 UTC (rev 1445) +++ trunk/complement/explore/include/mt/thr_mgr.h 2006-12-13 18:25:00 UTC (rev 1446) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/09/22 20:01:52 ptr> +// -*- C++ -*- Time-stamp: <06/12/13 17:41:15 ptr> /* * Copyright (c) 1997-1999, 2002, 2005, 2006 @@ -39,6 +39,7 @@ __FIT_DECLSPEC void launch( Thread::entrance_type entrance, const void *p = 0, size_t psz = 0, unsigned flags = 0, size_t stack_sz = 0 ); __FIT_DECLSPEC void garbage_collector(); + __FIT_DECLSPEC void join(); container_type::size_type size(); Modified: trunk/complement/explore/lib/mt/ChangeLog =================================================================== --- trunk/complement/explore/lib/mt/ChangeLog 2006-12-13 09:43:33 UTC (rev 1445) +++ trunk/complement/explore/lib/mt/ChangeLog 2006-12-13 18:25:00 UTC (rev 1446) @@ -1,3 +1,7 @@ +2006-12-13 Petr Ovtchenkov <pt...@is...> + + * thr_mgr.h, thr_mgr.cc: add join method. + 2006-11-29 Petr Ovtchenkov <pt...@is...> * xmt.h, xmt.cc: added xmt::getpid() and xmt:getppid(); ::getpid() Modified: trunk/complement/explore/lib/mt/thr_mgr.cc =================================================================== --- trunk/complement/explore/lib/mt/thr_mgr.cc 2006-12-13 09:43:33 UTC (rev 1445) +++ trunk/complement/explore/lib/mt/thr_mgr.cc 2006-12-13 18:25:00 UTC (rev 1446) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/10/10 19:33:54 ptr> +// -*- C++ -*- Time-stamp: <06/12/13 17:54:09 ptr> /* * Copyright (c) 1997-1999, 2002, 2005, 2006 @@ -28,7 +28,12 @@ __FIT_DECLSPEC ThreadMgr::~ThreadMgr() { - MT_REENTRANT( _lock, _x1 ); + ThreadMgr::join(); +} + +__FIT_DECLSPEC void ThreadMgr::join() +{ + Locker lk( _lock ); container_type::iterator i = _M_c.begin(); while ( i != _M_c.end() ) { @@ -41,6 +46,7 @@ } } + __FIT_DECLSPEC void ThreadMgr::launch( Thread::entrance_type entrance, const void *p, size_t psz, unsigned flags, size_t stack_sz ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-13 09:43:34
|
Revision: 1445 http://svn.sourceforge.net/complement/?rev=1445&view=rev Author: complement Date: 2006-12-13 01:43:33 -0800 (Wed, 13 Dec 2006) Log Message: ----------- try to test NetTransportMgr termination; don't foget build in dl Modified Paths: -------------- trunk/complement/explore/test/libstem/unit/Makefile trunk/complement/explore/test/libstem/unit/unit_test.cc Modified: trunk/complement/explore/test/libstem/unit/Makefile =================================================================== --- trunk/complement/explore/test/libstem/unit/Makefile 2006-12-13 09:41:52 UTC (rev 1444) +++ trunk/complement/explore/test/libstem/unit/Makefile 2006-12-13 09:43:33 UTC (rev 1445) @@ -1,8 +1,12 @@ -# -*- Makefile -*- Time-stamp: <06/08/04 12:09:33 ptr> +# -*- Makefile -*- Time-stamp: <06/12/13 01:07:22 ptr> SRCROOT := ../../.. COMPILER_NAME := gcc +EXTRA_POST := dl +EXTRA_POST_DBG := dl-dbg +EXTRA_POST_STLDBG := dl-stldbg + include Makefile.inc include ${SRCROOT}/Makefiles/top.mak @@ -18,3 +22,14 @@ dbg-shared: DEFS += -DDEBUG LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR}:${CoMT_LIB_DIR} + +PHONY += dl dl-dbg dl-stldbg + +dl: + ${MAKE} -C dl release-shared + +dl-dbg: + ${MAKE} -C dl dbg-shared + +dl-stldbg: + ${MAKE} -C dl stldbg-shared Modified: trunk/complement/explore/test/libstem/unit/unit_test.cc =================================================================== --- trunk/complement/explore/test/libstem/unit/unit_test.cc 2006-12-13 09:41:52 UTC (rev 1444) +++ trunk/complement/explore/test/libstem/unit/unit_test.cc 2006-12-13 09:43:33 UTC (rev 1445) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/11/30 22:13:51 ptr> +// -*- C++ -*- Time-stamp: <06/12/13 02:08:08 ptr> /* * Copyright (c) 2002, 2003, 2006 @@ -54,6 +54,7 @@ void echo(); void echo_net(); void peer(); + void boring_manager(); static xmt::Thread::ret_code thr1( void * ); static xmt::Thread::ret_code thr1new( void * ); @@ -595,6 +596,74 @@ shmctl( id, IPC_RMID, &ds ); } +void stem_test::boring_manager() +{ + shmid_ds ds; + int id = shmget( 5000, 1024, IPC_CREAT | IPC_EXCL | 0600 ); + BOOST_REQUIRE( id != -1 ); + // if ( id == -1 ) { + // cerr << "Error on shmget" << endl; + // } + BOOST_REQUIRE( shmctl( id, IPC_STAT, &ds ) != -1 ); + // if ( shmctl( id, IPC_STAT, &ds ) == -1 ) { + // cerr << "Error on shmctl" << endl; + // } + void *buf = shmat( id, 0, 0 ); + BOOST_REQUIRE( buf != reinterpret_cast<void *>(-1) ); + // if ( buf == reinterpret_cast<void *>(-1) ) { + // cerr << "Error on shmat" << endl; + // } + + xmt::__Condition<true>& fcnd = *new( buf ) xmt::__Condition<true>(); + fcnd.set( false ); + + try { + // Client + xmt::Thread::fork(); + try { + fcnd.try_wait(); + + for ( int i = 0; i < 10; ++i ) { + const int n = 10; + stem::NetTransportMgr *mgr[n]; + mgr[0] = new stem::NetTransportMgr; + mgr[0]->open( "localhost", 6995 ); + + for ( int j = 1; j < n; ++j ) { + mgr[j] = new stem::NetTransportMgr; + stem::addr_type a = mgr[j]->open( "localhost", 6995 ); + mgr[j]->close(); + mgr[j]->join(); + delete mgr[j]; + } + mgr[0]->close(); + mgr[0]->join(); + delete mgr[0]; + } + } + catch ( ... ) { + } + exit( 0 ); + } + catch ( xmt::fork_in_parent& child ) { + sockmgr_stream_MP<stem::NetTransport> srv( 6995 ); // server, it serve 'echo' + StEMecho echo( 0, "echo service"); // <= zero! 'echo' server, default ('zero' address) + + fcnd.set( true, true ); + + int stat; + waitpid( child.pid(), &stat, 0 ); + + srv.close(); + srv.wait(); + } + + (&fcnd)->~__Condition<true>(); + + shmdt( buf ); + shmctl( id, IPC_RMID, &ds ); +} + struct stem_test_suite : public test_suite { @@ -616,6 +685,7 @@ test_case *echo_tc = BOOST_CLASS_TEST_CASE( &stem_test::echo, instance ); test_case *echo_net_tc = BOOST_CLASS_TEST_CASE( &stem_test::echo_net, instance ); test_case *peer_tc = BOOST_CLASS_TEST_CASE( &stem_test::peer, instance ); + test_case *boring_manager_tc = BOOST_CLASS_TEST_CASE( &stem_test::boring_manager, instance ); basic2_tc->depends_on( basic1_tc ); basic1n_tc->depends_on( basic1_tc ); basic2n_tc->depends_on( basic2_tc ); @@ -626,6 +696,7 @@ echo_tc->depends_on( basic2_tc ); echo_net_tc->depends_on( echo_tc ); peer_tc->depends_on( echo_tc ); + boring_manager_tc->depends_on( peer_tc ); add( basic1_tc ); add( basic2_tc ); @@ -637,6 +708,7 @@ add( echo_tc ); add( echo_net_tc ); add( peer_tc ); + add( boring_manager_tc ); } test_suite *init_unit_test_suite( int argc, char **argv ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-13 09:42:03
|
Revision: 1444 http://svn.sourceforge.net/complement/?rev=1444&view=rev Author: complement Date: 2006-12-13 01:41:52 -0800 (Wed, 13 Dec 2006) Log Message: ----------- -fvisibilty=hidden require code preparation Modified Paths: -------------- trunk/complement/explore/Makefiles/gmake/gcc.mak Modified: trunk/complement/explore/Makefiles/gmake/gcc.mak =================================================================== --- trunk/complement/explore/Makefiles/gmake/gcc.mak 2006-12-12 08:22:57 UTC (rev 1443) +++ trunk/complement/explore/Makefiles/gmake/gcc.mak 2006-12-13 09:41:52 UTC (rev 1444) @@ -160,9 +160,25 @@ # Required for correct order of static objects dtors calls: ifneq ($(OSNAME),cygming) +ifneq ($(OSNAME),windows) +ifneq ($(OSNAME),darwin) +ifneq ($(CXX_VERSION_MAJOR),2) CXXFLAGS += -fuse-cxa-atexit endif +endif +endif +endif +# Code should be ready for this option +#ifneq ($(OSNAME),windows) +#ifneq ($(CXX_VERSION_MAJOR),2) +#ifneq ($(CXX_VERSION_MAJOR),3) +#CXXFLAGS += -fvisibility=hidden +#CFLAGS += -fvisibility=hidden +#endif +#endif +#endif + ifdef EXTRA_CXXFLAGS CXXFLAGS += ${EXTRA_CXXFLAGS} endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-12 08:22:58
|
Revision: 1443 http://svn.sourceforge.net/complement/?rev=1443&view=rev Author: complement Date: 2006-12-12 00:22:57 -0800 (Tue, 12 Dec 2006) Log Message: ----------- clean garbage; unify EXTRA_PRE/POST and POST_INSTALL for libs and applications Modified Paths: -------------- trunk/complement/explore/Makefiles/gmake/app/rules-install.mak trunk/complement/explore/Makefiles/gmake/linux/rules-so.mak Removed Paths: ------------- trunk/complement/explore/Makefiles/Makefile.inc trunk/complement/explore/Makefiles/Makefile.inc.KCC trunk/complement/explore/Makefiles/app/ trunk/complement/explore/Makefiles/lib/ Deleted: trunk/complement/explore/Makefiles/Makefile.inc =================================================================== --- trunk/complement/explore/Makefiles/Makefile.inc 2006-12-12 08:21:49 UTC (rev 1442) +++ trunk/complement/explore/Makefiles/Makefile.inc 2006-12-12 08:22:57 UTC (rev 1443) @@ -1,168 +0,0 @@ -# -*- Makefile -*- Time-stamp: <02/03/11 21:34:56 ptr> -# $Id$ - -DBG_SUFFIX = -g - -OUTPUT_DIR = obj/$(COMPILER_NAME)/shared$(EXTRA_DIRS) -OUTPUT_DIR_DBG = obj/$(COMPILER_NAME)/shared-g$(EXTRA_DIRS) -OUTPUT_DIR_STLDBG = obj/$(COMPILER_NAME)/shared-stlg$(EXTRA_DIRS) - -OUTPUT_DIR_A = obj/$(COMPILER_NAME)/static$(EXTRA_DIRS) -OUTPUT_DIR_A_DBG = obj/$(COMPILER_NAME)/static-g$(EXTRA_DIRS) -OUTPUT_DIR_A_STLDBG = obj/$(COMPILER_NAME)/static-stlg$(EXTRA_DIRS) - -INSTALL_LIB_DIR = ${BASEDIR}/build/lib -INSTALL_BIN_DIR = ${BASEDIR}/build/bin - -$(OUTPUT_DIR): - @if [ ! -d ${OUTPUT_DIR} ] ; then \ - mkdir -p $(OUTPUT_DIR) ; \ - fi - -$(OUTPUT_DIR_DBG): - @if [ ! -d ${OUTPUT_DIR_DBG} ] ; then \ - mkdir -p $(OUTPUT_DIR_DBG) ; \ - fi - -$(OUTPUT_DIR_STLDBG): - @if [ ! -d ${OUTPUT_DIR_STLDBG} ] ; then \ - mkdir -p $(OUTPUT_DIR_STLDBG) ; \ - fi - -$(OUTPUT_DIR_A): - @if [ ! -d ${OUTPUT_DIR_A} ] ; then \ - mkdir -p $(OUTPUT_DIR_A) ; \ - fi - -$(OUTPUT_DIR_A_DBG): - @if [ ! -d ${OUTPUT_DIR_A_DBG} ] ; then \ - mkdir -p $(OUTPUT_DIR_A_DBG) ; \ - fi - -$(OUTPUT_DIR_A_STLDBG): - @if [ ! -d ${OUTPUT_DIR_A_STLDBG} ] ; then \ - mkdir -p $(OUTPUT_DIR_A_STLDBG) ; \ - fi - -$(OUTPUT_DIR)/%.o: %.cc - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR)/%.o: %.cpp - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR)/%.o: %.c - $(COMPILE.c) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_DBG)/%.o: %.cc - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_DBG)/%.o: %.cpp - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_DBG)/%.o: %.c - $(COMPILE.c) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_STLDBG)/%.o: %.cc - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_STLDBG)/%.o: %.cpp - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_STLDBG)/%.o: %.c - $(COMPILE.c) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A)/%.o: %.cc - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A)/%.o: %.cpp - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A)/%.o: %.c - $(COMPILE.c) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_DBG)/%.o: %.cc - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_DBG)/%.o: %.cpp - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_DBG)/%.o: %.c - $(COMPILE.c) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_STLDBG)/%.o: %.cc - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_STLDBG)/%.o: %.cpp - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_STLDBG)/%.o: %.c - $(COMPILE.c) $(OUTPUT_OPTION) $< - -OBJ = $(SRC_CC:%.cc=$(OUTPUT_DIR)/%.o) -OBJ += $(SRC_CPP:%.cpp=$(OUTPUT_DIR)/%.o) -OBJ += $(SRC_C:%.c=$(OUTPUT_DIR)/%.o) -OBJ_DBG = $(SRC_CC:%.cc=$(OUTPUT_DIR_DBG)/%.o) -OBJ_DBG += $(SRC_CPP:%.cpp=$(OUTPUT_DIR_DBG)/%.o) -OBJ_DBG += $(SRC_C:%.c=$(OUTPUT_DIR_DBG)/%.o) -OBJ_STLDBG = $(SRC_CC:%.cc=$(OUTPUT_DIR_STLDBG)/%.o) -OBJ_STLDBG += $(SRC_CPP:%.cpp=$(OUTPUT_DIR_STLDBG)/%.o) -OBJ_STLDBG += $(SRC_C:%.c=$(OUTPUT_DIR_STLDBG)/%.o) -DEP = $(SRC_CC:%.cc=$(OUTPUT_DIR)/%.d) -DEP += $(SRC_CPP:%.cpp=$(OUTPUT_DIR)/%.d) -DEP += $(SRC_C:%.c=$(OUTPUT_DIR)/%.d) -DEP_DBG = $(SRC_CC:%.cc=$(OUTPUT_DIR_DBG)/%.d) -DEP_DBG += $(SRC_CPP:%.cpp=$(OUTPUT_DIR_DBG)/%.d) -DEP_DBG += $(SRC_C:%.c=$(OUTPUT_DIR_DBG)/%.d) -DEP_STLDBG = $(SRC_CC:%.cc=$(OUTPUT_DIR_STLDBG)/%.d) -DEP_STLDBG += $(SRC_CPP:%.cpp=$(OUTPUT_DIR_STLDBG)/%.d) -DEP_STLDBG += $(SRC_C:%.c=$(OUTPUT_DIR_STLDBG)/%.d) - -OBJ_A = $(SRC_CC:%.cc=$(OUTPUT_DIR_A)/%.o) -OBJ_A += $(SRC_CPP:%.cpp=$(OUTPUT_DIR_A)/%.o) -OBJ_A += $(SRC_C:%.c=$(OUTPUT_DIR_A)/%.o) -OBJ_A_DBG = $(SRC_CC:%.cc=$(OUTPUT_DIR_A_DBG)/%.o) -OBJ_A_DBG += $(SRC_CPP:%.cpp=$(OUTPUT_DIR_A_DBG)/%.o) -OBJ_A_DBG += $(SRC_C:%.c=$(OUTPUT_DIR_A_DBG)/%.o) -OBJ_A_STLDBG = $(SRC_CC:%.cc=$(OUTPUT_DIR_A_STLDBG)/%.o) -OBJ_A_STLDBG += $(SRC_CPP:%.cpp=$(OUTPUT_DIR_A_STLDBG)/%.o) -OBJ_A_STLDBG += $(SRC_C:%.c=$(OUTPUT_DIR_A_STLDBG)/%.o) -DEP_A = $(SRC_CC:%.cc=$(OUTPUT_DIR_A)/%.d) -DEP_A += $(SRC_CPP:%.cpp=$(OUTPUT_DIR_A)/%.d) -DEP_A += $(SRC_C:%.c=$(OUTPUT_DIR_A)/%.d) -DEP_A_DBG = $(SRC_CC:%.cc=$(OUTPUT_DIR_A_DBG)/%.d) -DEP_A_DBG += $(SRC_CPP:%.cpp=$(OUTPUT_DIR_A_DBG)/%.d) -DEP_A_DBG += $(SRC_C:%.c=$(OUTPUT_DIR_A_DBG)/%.d) -DEP_A_STLDBG = $(SRC_CC:%.cc=$(OUTPUT_DIR_A_STLDBG)/%.d) -DEP_A_STLDBG += $(SRC_CPP:%.cpp=$(OUTPUT_DIR_A_STLDBG)/%.d) -DEP_A_STLDBG += $(SRC_C:%.c=$(OUTPUT_DIR_A_STLDBG)/%.d) - -clear-release-shared:: - @-rm -f $(OBJ) $(DEP) - -clear-release-static:: - @-rm -f $(OBJ_A) $(DEP_A) - -clear-dbg-shared:: - @-rm -f $(OBJ_DBG) $(DEP_DBG) - -clear-stldbg-shared:: - @-rm -f $(OBJ_STLDBG) $(DEP_STLDBG) - -clear-dbg-static:: - @-rm -f $(OBJ_A_DBG) $(DEP_A_DBG) - -clear-stldbg-static:: - @-rm -f $(OBJ_A_STLDBG) $(DEP_A_STLDBG) - -clear:: clear-release-shared \ - clear-dbg-shared clear-stldbg-shared \ - clear-release-static \ - clear-dbg-static clear-stldbg-static - rm -f .make.state core .make.depend - -# %.o: ../%.cc -# $(COMPILE.cc) $(OUTPUT_OPTION) $< -# -#%.o: ../%.c -# $(COMPILE.c) $(OUTPUT_OPTION) $< - Deleted: trunk/complement/explore/Makefiles/Makefile.inc.KCC =================================================================== --- trunk/complement/explore/Makefiles/Makefile.inc.KCC 2006-12-12 08:21:49 UTC (rev 1442) +++ trunk/complement/explore/Makefiles/Makefile.inc.KCC 2006-12-12 08:22:57 UTC (rev 1443) @@ -1,38 +0,0 @@ -# Time-stamp: <99/12/23 14:17:26 ptr> -# $SunId$ %Q% - -.KEEP_STATE: -.PARALLEL: -.SUFFIXES: -.SCCS_GET: - -OS_VER:sh =uname -sr | sed -e s/\[\.\ \]/_/g - -INCLUDES = -I$(BASEDIR)/include/stlport-3.2.2 - -DEFS = -D__$(OS_VER) - -CCC = KCC -INSTALL = /usr/ucb/install -# OUTPUT_DIR = obj -OUTPUT_OPTION = -o $@ -CPPFLAGS = $(DEFS) $(INCLUDES) -LDFLAGS = -libdbg_a := DEFS += -D_DEBUG -D_DEBUG_ALLOC -libdbg_so := DEFS += -D_DEBUG -D_DEBUG_ALLOC -dbg := DEFS += -D_DEBUG -D_DEBUG_ALLOC - -# For CC - -dbg := OPT = -g +K0 -libdbg_a := OPT = -g +K0 -libdbg_so := OPT = -g +K0 -Kpic -CCFLAGS = --thread_safe $(OPT) -libdbg_a := LDFLAGS += -libdbg_so := LDFLAGS += - -%.o: ../%.cc - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -clear:: - ?-rm -f .make.state core Modified: trunk/complement/explore/Makefiles/gmake/app/rules-install.mak =================================================================== --- trunk/complement/explore/Makefiles/gmake/app/rules-install.mak 2006-12-12 08:21:49 UTC (rev 1442) +++ trunk/complement/explore/Makefiles/gmake/app/rules-install.mak 2006-12-12 08:22:57 UTC (rev 1443) @@ -1,4 +1,4 @@ -# -*- makefile -*- Time-stamp: <06/11/17 00:21:21 ptr> +# -*- makefile -*- Time-stamp: <06/12/12 09:37:04 ptr> # # Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 # Petr Ovtchenkov @@ -47,12 +47,14 @@ $(INSTALL_EXE) ${PRG} $(INSTALL_BIN_DIR)/${INSTALL_PRGNAME} endif $(INSTALL_PRGNAME_CMD) + $(POST_INSTALL) install-dbg-shared: dbg-shared $(INSTALL_BIN_DIR_DBG) ifdef PRGNAME $(INSTALL_EXE) ${PRG_DBG} $(INSTALL_BIN_DIR_DBG)/${INSTALL_PRGNAME_DBG} endif $(INSTALL_PRGNAME_CMD_DBG) + $(POST_INSTALL_DBG) ifndef WITHOUT_STLPORT install-stldbg-shared: stldbg-shared $(INSTALL_BIN_DIR_STLDBG) @@ -60,4 +62,5 @@ $(INSTALL_EXE) ${PRG_STLDBG} $(INSTALL_BIN_DIR_STLDBG)/${INSTALL_PRGNAME_STLDBG} endif $(INSTALL_PRGNAME_CMD_STLDBG) + $(POST_INSTALL_STLDBG) endif Modified: trunk/complement/explore/Makefiles/gmake/linux/rules-so.mak =================================================================== --- trunk/complement/explore/Makefiles/gmake/linux/rules-so.mak 2006-12-12 08:21:49 UTC (rev 1442) +++ trunk/complement/explore/Makefiles/gmake/linux/rules-so.mak 2006-12-12 08:22:57 UTC (rev 1443) @@ -1,4 +1,4 @@ -# -*- makefile -*- Time-stamp: <06/11/11 00:23:27 ptr> +# -*- makefile -*- Time-stamp: <06/12/12 09:43:02 ptr> # # Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 # Petr Ovtchenkov @@ -13,12 +13,12 @@ PHONY += release-shared dbg-shared stldbg-shared -release-shared: $(OUTPUT_DIR) ${SO_NAME_OUTxxx} +release-shared: $(EXTRA_PRE) $(OUTPUT_DIR) ${SO_NAME_OUTxxx} $(EXTRA_POST) -dbg-shared: $(OUTPUT_DIR_DBG) ${SO_NAME_OUT_DBGxxx} +dbg-shared: $(EXTRA_PRE_DBG) $(OUTPUT_DIR_DBG) ${SO_NAME_OUT_DBGxxx} $(EXTRA_POST_DBG) ifndef WITHOUT_STLPORT -stldbg-shared: $(OUTPUT_DIR_STLDBG) ${SO_NAME_OUT_STLDBGxxx} +stldbg-shared: $(EXTRA_PRE_STLDBG) $(OUTPUT_DIR_STLDBG) ${SO_NAME_OUT_STLDBGxxx} $(EXTRA_POST_STLDBG) endif define do_so_links_1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-12 08:21:50
|
Revision: 1442 http://svn.sourceforge.net/complement/?rev=1442&view=rev Author: complement Date: 2006-12-12 00:21:49 -0800 (Tue, 12 Dec 2006) Log Message: ----------- unit tests for make system Added Paths: ----------- trunk/complement/explore/Makefiles/ut/ trunk/complement/explore/Makefiles/ut/so1/ trunk/complement/explore/Makefiles/ut/so1/Makefile trunk/complement/explore/Makefiles/ut/so1/Makefile.inc trunk/complement/explore/Makefiles/ut/so1/test_c.cc trunk/complement/explore/Makefiles/ut/so1/test_cc.cc Property changes on: trunk/complement/explore/Makefiles/ut/so1 ___________________________________________________________________ Name: svn:ignore + obj Added: trunk/complement/explore/Makefiles/ut/so1/Makefile =================================================================== --- trunk/complement/explore/Makefiles/ut/so1/Makefile (rev 0) +++ trunk/complement/explore/Makefiles/ut/so1/Makefile 2006-12-12 08:21:49 UTC (rev 1442) @@ -0,0 +1,18 @@ +# -*- Makefile -*- Time-stamp: <06/11/10 16:23:01 ptr> + +SRCROOT := ../../.. +EXTRA_POST := checks + +include Makefile.inc +include ${SRCROOT}/Makefiles/top.mak + +INCLUDES += -I./include + +checks: + file ${SO_NAME_OUTxxx} | grep ELF >/dev/null || exit 1 + file ${SO_NAME_OUTxx} | grep link >/dev/null || exit 1 + file ${SO_NAME_OUTx} | grep link >/dev/null || exit 1 + file ${SO_NAME_OUT} | grep link >/dev/null || exit 1 + +PHONY += checks + Added: trunk/complement/explore/Makefiles/ut/so1/Makefile.inc =================================================================== --- trunk/complement/explore/Makefiles/ut/so1/Makefile.inc (rev 0) +++ trunk/complement/explore/Makefiles/ut/so1/Makefile.inc 2006-12-12 08:21:49 UTC (rev 1442) @@ -0,0 +1,8 @@ +# -*- Makefile -*- Time-stamp: <06/11/29 01:59:50 ptr> + +LIBNAME = test +MAJOR = 0 +MINOR = 1 +PATCH = 2 +SRC_CC = test_cc.cc +SRC_C = test_c.c Added: trunk/complement/explore/Makefiles/ut/so1/test_c.cc =================================================================== --- trunk/complement/explore/Makefiles/ut/so1/test_c.cc (rev 0) +++ trunk/complement/explore/Makefiles/ut/so1/test_c.cc 2006-12-12 08:21:49 UTC (rev 1442) @@ -0,0 +1,4 @@ +int g() +{ + return 0; +} Added: trunk/complement/explore/Makefiles/ut/so1/test_cc.cc =================================================================== --- trunk/complement/explore/Makefiles/ut/so1/test_cc.cc (rev 0) +++ trunk/complement/explore/Makefiles/ut/so1/test_cc.cc 2006-12-12 08:21:49 UTC (rev 1442) @@ -0,0 +1,4 @@ +int f() +{ + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-12 08:20:45
|
Revision: 1441 http://svn.sourceforge.net/complement/?rev=1441&view=rev Author: complement Date: 2006-12-12 00:20:45 -0800 (Tue, 12 Dec 2006) Log Message: ----------- ignore tags Property Changed: ---------------- trunk/complement/explore/lib/mt/ Property changes on: trunk/complement/explore/lib/mt ___________________________________________________________________ Name: svn:ignore - obj VC.DSW VC.OPT VC.dsp VC.ncb VC.plg *.d .make.depend + obj VC.DSW VC.OPT VC.dsp VC.ncb VC.plg *.d .make.depend TAGS tags This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-12 08:20:22
|
Revision: 1440 http://svn.sourceforge.net/complement/?rev=1440&view=rev Author: complement Date: 2006-12-12 00:20:21 -0800 (Tue, 12 Dec 2006) Log Message: ----------- play with two programs from same catalog Modified Paths: -------------- trunk/complement/explore/inquiry/shades/msgq/Makefile trunk/complement/explore/inquiry/shades/msgq/Makefile.inc trunk/complement/explore/inquiry/shades/msgq/test.cc Added Paths: ----------- trunk/complement/explore/inquiry/shades/msgq/test2.cc Modified: trunk/complement/explore/inquiry/shades/msgq/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/msgq/Makefile 2006-12-12 08:19:17 UTC (rev 1439) +++ trunk/complement/explore/inquiry/shades/msgq/Makefile 2006-12-12 08:20:21 UTC (rev 1440) @@ -1,6 +1,10 @@ -# -*- Makefile -*- Time-stamp: <04/01/09 16:53:50 ptr> +# -*- Makefile -*- Time-stamp: <06/11/13 23:03:45 ptr> SRCROOT := ../../.. include Makefile.inc include ${SRCROOT}/Makefiles/top.mak + +ifndef WITHOUT_STLPORT +LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} +endif Modified: trunk/complement/explore/inquiry/shades/msgq/Makefile.inc =================================================================== --- trunk/complement/explore/inquiry/shades/msgq/Makefile.inc 2006-12-12 08:19:17 UTC (rev 1439) +++ trunk/complement/explore/inquiry/shades/msgq/Makefile.inc 2006-12-12 08:20:21 UTC (rev 1440) @@ -1,5 +1,7 @@ # -*- makefile -*- Time-stamp: <04/01/12 15:37:40 ptr> PRGNAME = test +PRGNAMES = test2 #SRC_C = test.c SRC_CC = test.cc +test2_SRC_CC = test2.cc Modified: trunk/complement/explore/inquiry/shades/msgq/test.cc =================================================================== --- trunk/complement/explore/inquiry/shades/msgq/test.cc 2006-12-12 08:19:17 UTC (rev 1439) +++ trunk/complement/explore/inquiry/shades/msgq/test.cc 2006-12-12 08:20:21 UTC (rev 1440) @@ -8,9 +8,11 @@ int main( int argc, char **argv ) { - // key_t key = 12345; - key_t key = ftok( "/tmp/msg.queue", 276 ); + key_t key = 12345; + // key_t key = ftok( "/tmp/msg.queue", 276 ); + cerr << key << endl; + int msqid = msgget( key /* IPC_PRIVATE */, 0666 | IPC_CREAT ); if ( msqid < 0 ) { @@ -29,14 +31,8 @@ << oct << buf.msg_perm.mode << dec << "\n" << buf.msg_qbytes << endl; - // if ( msgctl( msqid, IPC_RMID, &buf ) ) { - // cerr << "Can't remove message queue" << endl; - // return 4; - // } - return 0; - - +#if 0 buf.msg_qbytes = /* 16384; */ 256 * 1024 * 1024; if ( msgctl( msqid, IPC_SET, &buf ) < 0 ) { @@ -48,6 +44,16 @@ cerr << "Can't stat message queue" << endl; return 2; } +#endif return 0; + +#if 0 + if ( msgctl( msqid, IPC_RMID, &buf ) ) { + cerr << "Can't remove message queue" << endl; + return 4; + } + + return 0; +#endif } Added: trunk/complement/explore/inquiry/shades/msgq/test2.cc =================================================================== --- trunk/complement/explore/inquiry/shades/msgq/test2.cc (rev 0) +++ trunk/complement/explore/inquiry/shades/msgq/test2.cc 2006-12-12 08:20:21 UTC (rev 1440) @@ -0,0 +1,59 @@ +#include <sys/ipc.h> +#include <sys/msg.h> + +#include <iostream> +#include <iomanip> + +using namespace std; + +int main( int argc, char **argv ) +{ + key_t key = 12345; + // key_t key = ftok( "/tmp/msg.queue", 276 ); + + cerr << key << endl; + + int msqid = msgget( key /* IPC_PRIVATE */, 0666 | IPC_CREAT ); + + if ( msqid < 0 ) { + cerr << "Can't create message queue" << endl; + return 1; + } + + + struct msqid_ds buf; + if ( msgctl( msqid, IPC_STAT, &buf ) < 0 ) { + cerr << "Can't stat message queue" << endl; + return 2; + } + + cout << buf.msg_perm.uid << "\n" << buf.msg_perm.gid << "\n" + << oct << buf.msg_perm.mode << dec << "\n" + << buf.msg_qbytes << endl; + + +#if 0 + buf.msg_qbytes = /* 16384; */ 256 * 1024 * 1024; + + if ( msgctl( msqid, IPC_SET, &buf ) < 0 ) { + cerr << "Can't set message queue params" << endl; + return 3; + } + + if ( msgctl( msqid, IPC_STAT, &buf ) < 0 ) { + cerr << "Can't stat message queue" << endl; + return 2; + } +#endif + + return 0; + +#if 0 + if ( msgctl( msqid, IPC_RMID, &buf ) ) { + cerr << "Can't remove message queue" << endl; + return 4; + } + + return 0; +#endif +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-12 08:19:19
|
Revision: 1439 http://svn.sourceforge.net/complement/?rev=1439&view=rev Author: complement Date: 2006-12-12 00:19:17 -0800 (Tue, 12 Dec 2006) Log Message: ----------- bug in STLport 5.0.x Added Paths: ----------- trunk/complement/explore/inquiry/STLport/multimap/ trunk/complement/explore/inquiry/STLport/multimap/Makefile trunk/complement/explore/inquiry/STLport/multimap/Makefile.inc trunk/complement/explore/inquiry/STLport/multimap/TestSTLHash.cpp Property changes on: trunk/complement/explore/inquiry/STLport/multimap ___________________________________________________________________ Name: svn:ignore + obj Added: trunk/complement/explore/inquiry/STLport/multimap/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/multimap/Makefile (rev 0) +++ trunk/complement/explore/inquiry/STLport/multimap/Makefile 2006-12-12 08:19:17 UTC (rev 1439) @@ -0,0 +1,10 @@ +# -*- Makefile -*- Time-stamp: <03/07/09 18:08:47 ptr> + +SRCROOT := ../../.. +COMPILER_NAME := gcc + +include Makefile.inc +include ${SRCROOT}/Makefiles/top.mak + + +LDFLAGS += -Wl,-rpath=$(STLPORT_LIB_DIR) Added: trunk/complement/explore/inquiry/STLport/multimap/Makefile.inc =================================================================== --- trunk/complement/explore/inquiry/STLport/multimap/Makefile.inc (rev 0) +++ trunk/complement/explore/inquiry/STLport/multimap/Makefile.inc 2006-12-12 08:19:17 UTC (rev 1439) @@ -0,0 +1,4 @@ +# -*- makefile -*- Time-stamp: <02/07/14 14:03:13 ptr> + +PRGNAME = testhash +SRC_CPP = TestSTLHash.cpp Added: trunk/complement/explore/inquiry/STLport/multimap/TestSTLHash.cpp =================================================================== --- trunk/complement/explore/inquiry/STLport/multimap/TestSTLHash.cpp (rev 0) +++ trunk/complement/explore/inquiry/STLport/multimap/TestSTLHash.cpp 2006-12-12 08:19:17 UTC (rev 1439) @@ -0,0 +1,133 @@ +// TestSTLHash.cpp +// Short demonstrator that helps reproducing a bug in the hash-table implementation +// of STLPort 5.0.1/5.0.2 when using Microsoft Visual C++ 2005 on Windows XP. +// +// Problem: Fill a hash_multimap with entries of which many have the same key +// Internally, entries with the same key are kept as one block within the same bucket. +// Thus, when calling equal_range(key) the begin/end of that block is returned. +// However, this code shows that for key =3, that block is destroyed after inserting the 194th element. +// According to _hashtable.c we will have a rehash from size 193 to size 389 in that situation. +// After that rehash, equal_range only returns 2 elements with key = 3 whereas there are 65 in it. +// Reproduction: +// In the main()-method we fill a hash_multimap as well as a multi_map with the same <key, data> pairs +// After each insertion we call CHECK(...) to assure validity of these two containers. +// This works fine up to the 193th insertion. Insertion 194 generates the bug. +// +// CHECK() works as follows: +// (a) we check whether both containers contain the same number of elements. +// (b) Assuming that the multi_map works correctly, we iterate over all its elements and check +// whether we can find that key also in the hash_multimap. We collect all data for that specific +// key in in a set ("collection"). Notice that data is unique by construction in main(), thus the +// number of elements in the set must equal the number of entries in the hash_multimap and in the multimap +// (c) We check if we have seen as many data elements in collection as we have seen in the multimap. +// if so, we print "OK", otherwise we print a detailed key/data overview and assert. +// Caution: +// There are several configurations of the program that will NOT fail. (see comment in main()) +// E.g. it seems that whenever the keys are more or less sorted, the problem does not occur. +// Also, using numbers from 200 downto 1 or from 300 downto 1 cannot generate the problem, +// whereas using 400 downto 1 will fail. +// Finally, if we use key 1 (rather than key 3) we cannot generate a problem. + +// #define _STLP_DEBUG + +#include <iostream> +#include <hash_map> +#include <map> +#include <set> +#include <cassert> + +using namespace std; + +typedef hash_multimap<int, int> hashType ; +typedef multimap<int, int> mapType ; + + +void check(hashType &h, mapType &m) +{ + set<int> collection; + + // (a) check sizes + assert (h.size() == m.size()); + cout << "Checking Hash-Size: " << static_cast<unsigned>(h.size()) ; + + // (b) iterate over multi_map + for (mapType::iterator mIter = m.begin(); mIter != m.end(); mIter++) + { + // look up that key in hash-table and keep all data in the set + pair<hashType::iterator,hashType::iterator> range = h.equal_range(mIter->first); + for (hashType::iterator h = range.first; h != range.second; h++) + { + collection.insert (h->second); + } + } + + // (c) we should have seen as many elements as there are in the hash-table + if (collection.size() == h.size()) cout << " OK" << endl; + else + { + // if not, please report + cout << " FAILED: " << endl; + int lastKey = -1; + // iterate over all elements in multi_map + for (mapType::iterator mIter = m.begin(); mIter != m.end(); mIter++) + { + // new key? print a new status line + if (mIter->first != lastKey) + { + cout << endl << "Key : " << mIter->first << endl; + lastKey = mIter->first; + + // print all hashed values for that key + cout << " data in hash: "; + pair<hashType::iterator,hashType::iterator> range = h.equal_range(mIter->first); + for (hashType::iterator h = range.first; h != range.second; h++) + { + assert (h->first == lastKey); + cerr << h->second << ", "; // print all data for that key in Hash-Table + } + cout << endl << " data in map: "; + } + // and print all member in multi-map until the next key occurs + cout << mIter->second << ", " ; // print all data for that key in Map + } + } + assert (collection.size() == h.size()); // stopper + +} + + +int main(int argc, char* argv[]) +{ + hashType h; + mapType m; + + // CAUTION the following configurations WORKS in our setting + // for (int id = 1; id != 400; id ++) and int key = (id %3 == 0 ? 3 : id) + // for (int id = 200; id != 1; id --) and int key = (id %3 == 0 ? 3 : id) + // for (int id = 300; id != 1; id --) and int key = (id %3 == 0 ? 3 : id) + // for (int id = 400; id != 1; id --) and int key = (id %3 == 0 ? 1 : id) + // for (int id = 4000; id != 1; id --) and int key = (id %3 == 0 ? 1 : id) + // + // whereas these will FAIL + // for (int id = 400; id != 1; id --) and int key = (id %3 == 0 ? 3 : id) + // for (int id = 4000; id != 1; id --) and int key = (id %3 == 0 ? 3 : id) + // + + for (int id = 400; id != 1; id --) + { + // generate many entries with key 3, fill up with unique keys. Data is unique (needed in check()) + int key = (id %3 == 0 ? 3 : id); + + // keep hash_multi_map and multimap in sync + h.insert (make_pair(key, id)); + m.insert (make_pair(key, id)); + + // check whether both contain the same elements + check(h,m); + } + + return 0; +} + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-12 06:50:26
|
Revision: 1438 http://svn.sourceforge.net/complement/?rev=1438&view=rev Author: complement Date: 2006-12-11 22:50:25 -0800 (Mon, 11 Dec 2006) Log Message: ----------- incorporated into trunk Removed Paths: ------------- branches/Makefiles/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-06 12:30:44
|
Revision: 1437 http://svn.sourceforge.net/complement/?rev=1437&view=rev Author: complement Date: 2006-12-06 04:30:41 -0800 (Wed, 06 Dec 2006) Log Message: ----------- few renaming; start make description; update CMS info, ref to project's page at SF Modified Paths: -------------- trunk/WWW/explore/Complement/Content.shtml trunk/WWW/explore/Complement/ContentTech.shtml Added Paths: ----------- trunk/WWW/explore/Complement/Anti-autotools.shtml trunk/WWW/explore/Complement/MakeTags.shtml trunk/WWW/explore/Complement/SVN.shtml Removed Paths: ------------- trunk/WWW/explore/Complement/BuildSystem.shtml trunk/WWW/explore/Complement/CVS.shtml Copied: trunk/WWW/explore/Complement/Anti-autotools.shtml (from rev 1436, trunk/WWW/explore/Complement/BuildSystem.shtml) =================================================================== --- trunk/WWW/explore/Complement/Anti-autotools.shtml (rev 0) +++ trunk/WWW/explore/Complement/Anti-autotools.shtml 2006-12-06 12:30:41 UTC (rev 1437) @@ -0,0 +1,183 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<!-- Time-stamp: <03/10/07 15:50:35 ptr> --> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <link rel="stylesheet" type="text/css" href="main.css" media="screen" title="general"> + <link rel="stylesheet" type="text/css" href="decor.css" media="screen" title="general"> + <link rel="stylesheet" type="text/css" href="float.css" media="screen" title="general"> + <title>Complement: Anti-autotools</title> + </head> + + <body> +<!--#include file="head-tech.shtml" --> +<div class="toppic"> +<img src="img/jpg/apropos.jpg"> +</div> +<div class="main"> + <h2 class="lheader">Why I hate autotools</h2> + <dl> + <dt>Myth 1. Autotools isolate programmer from platform software.</dt> + <dd> + Do you ever try to build some real project with autotools (with ./configure) + with some compiler different from gcc? I do. I spent much more time to + say what compiler name I need, what options I need, what options I don't + to see, etc. etc. then for code portability itself! I.e. I spent more + time to boring tools that was intended for screen portabilty problems.<br> + + This problem even worse. Autotools incompatible between versions of autotools. + When automake installed on you system too old for one project, it too new + for another. It's a big luck when only warning happens. + </dd> + + <dt>Myth 2. Autotools help to write portable code.</dt> + + <dd> + The case when platform A has function with name foo, platform B has function with + name boo, that implement the same paradigm as foo on platform A. Programmer + should worry about paradigm difference youself, autotools can't help too much here. + Really I can say: 'my code work on platform A' only if I at least compile + it for platform A. Or at least check the difference between platform A and platform + B, if I know what happens on platform B. Autotools don't magically provide + workarounds for platform A. I, as programmer, should know about platform A speciality, and should + worry about it. + </dd> + + <dt>Myth 3. Autotools provide easy-to-use build system.</dt> + <dd> Well, while you use autotools only to build projects: + +<pre class="ddisplay"> +./configure && make && make install +</pre> + + all fine and you happy. Nice! But if you developer, not all so good: +<pre class="ddisplay"> +autoreconf +... +./configure +... +make +... +Boom! +make clean +... +Boom! +make distclean +... +autoreconf +... +automake +... +./configure +... +make +</pre> + Hmm, I should pass <tt>-DUSE_FEATURE_BOO=2</tt> for program <tt>boo</tt>! +<pre class="ddisplay"> +make distclean; autoreconf && automake && ./configure && make +</pre> + Ufff...<br> + + It very annoying, especially if I know that all this job may be done + within make tool only, without other bloated scripts.<br> + + What about this checks: +<pre class="ddisplay"> +checking for g77... no +checking for f77... no +checking for xlf... no +checking for frt... no +checking for pgf77... no +checking for cf77... no +checking for fort77... no +checking for fl32... no +checking for af77... no +checking for f90... no +checking for xlf90... no +checking for pgf90... no +checking for pghpf... no +checking for epcf90... no +checking for gfortran... no +checking for g95... no +checking for f95... no +checking for fort... no +checking for xlf95... no +checking for ifort... no +checking for ifc... no +checking for efc... no +checking for pgf95... no +checking for lf95... no +checking for ftn... no +checking whether we are using the GNU Fortran 77 compiler... no +</pre> + when I have no fortran code? Note, that this check may be not only annoying, + but block build on insignificant check. + </dd> + </dl> + + Yet another. What you think about pollution by generated file (.o, .la, ...) + in the same place where you source files situated? Can you hide this intermediate + results someware else? I can. Autotools can't. Only with libtool, that + block cross-compilation (it finding native libraries, instead of cross). + + <h2 class="lheader">What instead?</h2> + + <p> + First, let's say that informing about and passing specific configuration options 'configure' + do well. But this not require shell script 700K in size. + </p> + + <p> + Then, we can see that 'make' and friends is very power tool. Just let's allow + do it job well! + </p> + + <p> + You have 'common' flow, i.e. compile object files from C source, link the set of + object files into executable or shared object. And, sometimes, you need original + operations, like generation of C file from some meta-language with some + tool. Build system provide easy suggestion for common tasks, and allow you + do original builds as you want. I.e. build system may worry about transformation + from file.cc to file.o to file.so, take into account dependency and generate + TAGS for emacs. If you don't want here something else, of cause. + </p> + + <p> + As simplest example, I use two files to build <b>xmt</b> library on a wide set of + platforms: + </p> +<pre class="ddisplay"> +# -*- Makefile -*- Time-stamp: <06/11/10 16:23:01 ptr> + +SRCROOT := ../.. + +include Makefile.inc +include ${SRCROOT}/Makefiles/top.mak + +INCLUDES += -I$(SRCROOT)/include +</pre> + <p> + and <tt>Makefile.inc</tt> + </p> +<pre class="ddisplay"> +# -*- Makefile -*- Time-stamp: <06/11/29 01:59:50 ptr> + +LIBNAME = xmt +MAJOR = 1 +MINOR = 9 +PATCH = 3 +SRC_CC = xmt.cc thr_mgr.cc time.cc uid.cc +SRC_C = fl.c +</pre> + <p> + Really first file vary for different compilers (and very different for + Redmond's nmake) but the second (<tt>Makefile.inc</tt>) is one for all. + </p> +</div> +<!--#include file="foot.shtml" --> +<!-- Created: Mon Oct 7 16:33:17 MSD 2002 --> + </body> +</html> + Deleted: trunk/WWW/explore/Complement/BuildSystem.shtml =================================================================== --- trunk/WWW/explore/Complement/BuildSystem.shtml 2006-12-05 18:29:42 UTC (rev 1436) +++ trunk/WWW/explore/Complement/BuildSystem.shtml 2006-12-06 12:30:41 UTC (rev 1437) @@ -1,183 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> - -<!-- Time-stamp: <03/10/07 15:50:35 ptr> --> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <link rel="stylesheet" type="text/css" href="main.css" media="screen" title="general"> - <link rel="stylesheet" type="text/css" href="decor.css" media="screen" title="general"> - <link rel="stylesheet" type="text/css" href="float.css" media="screen" title="general"> - <title>Complement: Build System</title> - </head> - - <body> -<!--#include file="head-tech.shtml" --> -<div class="toppic"> -<img src="img/jpg/apropos.jpg"> -</div> -<div class="main"> - <h2 class="lheader">Why I hate autotools</h2> - <dl> - <dt>Myth 1. Autotools isolate programmer from platform software.</dt> - <dd> - Do you ever try to build some real project with autotools (with ./configure) - with some compiler different from gcc? I do. I spent much more time to - say what compiler name I need, what options I need, what options I don't - to see, etc. etc. then for code portability itself! I.e. I spent more - time to boring tools that was intended for screen portabilty problems.<br> - - This problem even worse. Autotools incompatible between versions of autotools. - When automake installed on you system too old for one project, it too new - for another. It's a big luck when only warning happens. - </dd> - - <dt>Myth 2. Autotools help to write portable code.</dt> - - <dd> - The case when platform A has function with name foo, platform B has function with - name boo, that implement the same paradigm as foo on platform A. Programmer - should worry about paradigm difference youself, autotools can't help too much here. - Really I can say: 'my code work on platform A' only if I at least compile - it for platform A. Or at least check the difference between platform A and platform - B, if I know what happens on platform B. Autotools don't magically provide - workarounds for platform A. I, as programmer, should know about platform A speciality, and should - worry about it. - </dd> - - <dt>Myth 3. Autotools provide easy-to-use build system.</dt> - <dd> Well, while you use autotools only to build projects: - -<pre class="ddisplay"> -./configure && make && make install -</pre> - - all fine and you happy. Nice! But if you developer, not all so good: -<pre class="ddisplay"> -autoreconf -... -./configure -... -make -... -Boom! -make clean -... -Boom! -make distclean -... -autoreconf -... -automake -... -./configure -... -make -</pre> - Hmm, I should pass <tt>-DUSE_FEATURE_BOO=2</tt> for program <tt>boo</tt>! -<pre class="ddisplay"> -make distclean; autoreconf && automake && ./configure && make -</pre> - Ufff...<br> - - It very annoying, especially if I know that all this job may be done - within make tool only, without other bloated scripts.<br> - - What about this checks: -<pre class="ddisplay"> -checking for g77... no -checking for f77... no -checking for xlf... no -checking for frt... no -checking for pgf77... no -checking for cf77... no -checking for fort77... no -checking for fl32... no -checking for af77... no -checking for f90... no -checking for xlf90... no -checking for pgf90... no -checking for pghpf... no -checking for epcf90... no -checking for gfortran... no -checking for g95... no -checking for f95... no -checking for fort... no -checking for xlf95... no -checking for ifort... no -checking for ifc... no -checking for efc... no -checking for pgf95... no -checking for lf95... no -checking for ftn... no -checking whether we are using the GNU Fortran 77 compiler... no -</pre> - when I have no fortran code? Note, that this check may be not only annoying, - but block build on insignificant check. - </dd> - </dl> - - Yet another. What you think about pollution by generated file (.o, .la, ...) - in the same place where you source files situated? Can you hide this intermediate - results someware else? I can. Autotools can't. Only with libtool, that - block cross-compilation (it finding native libraries, instead of cross). - - <h2 class="lheader">What instead?</h2> - - <p> - First, let's say that informing about and passing specific configuration options 'configure' - do well. But this not require shell script 700K in size. - </p> - - <p> - Then, we can see that 'make' and friends is very power tool. Just let's allow - do it job well! - </p> - - <p> - You have 'common' flow, i.e. compile object files from C source, link the set of - object files into executable or shared object. And, sometimes, you need original - operations, like generation of C file from some meta-language with some - tool. Build system provide easy suggestion for common tasks, and allow you - do original builds as you want. I.e. build system may worry about transformation - from file.cc to file.o to file.so, take into account dependency and generate - TAGS for emacs. If you don't want here something else, of cause. - </p> - - <p> - As simplest example, I use two files to build <b>xmt</b> library on a wide set of - platforms: - </p> -<pre class="ddisplay"> -# -*- Makefile -*- Time-stamp: <06/11/10 16:23:01 ptr> - -SRCROOT := ../.. - -include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak - -INCLUDES += -I$(SRCROOT)/include -</pre> - <p> - and <tt>Makefile.inc</tt> - </p> -<pre class="ddisplay"> -# -*- Makefile -*- Time-stamp: <06/11/29 01:59:50 ptr> - -LIBNAME = xmt -MAJOR = 1 -MINOR = 9 -PATCH = 3 -SRC_CC = xmt.cc thr_mgr.cc time.cc uid.cc -SRC_C = fl.c -</pre> - <p> - Really first file vary for different compilers (and very different for - Redmond's nmake) but the second (<tt>Makefile.inc</tt>) is one for all. - </p> -</div> -<!--#include file="foot.shtml" --> -<!-- Created: Mon Oct 7 16:33:17 MSD 2002 --> - </body> -</html> - Deleted: trunk/WWW/explore/Complement/CVS.shtml =================================================================== --- trunk/WWW/explore/Complement/CVS.shtml 2006-12-05 18:29:42 UTC (rev 1436) +++ trunk/WWW/explore/Complement/CVS.shtml 2006-12-06 12:30:41 UTC (rev 1437) @@ -1,70 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> - -<!-- Time-stamp: <03/05/04 20:33:15 ptr> --> -<!-- $Id$ --> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <link rel="stylesheet" type="text/css" href="main.css" media="screen" title="general"> - <link rel="stylesheet" type="text/css" href="decor.css" media="screen" title="general"> - <link rel="stylesheet" type="text/css" href="float.css" media="screen" title="general"> - <title>Complement: CVS access</title> - </head> - - <body> -<!--#include file="head.shtml" --> -<div class="toppic"> -<img src="img/jpg/cvs.jpg"> -</div> -<div class="main"> -<!-- <h2 class="lheader">CVS access</h2> --> - - <p> - You can read directives for CVS access either - <a href="http://sourceforge.net/cvs/?group_id=63160">on SourceForge page</a> - or below on this page. - </p> - - <h2 class="lheader">Anonymous CVS Access</h2> - - <p> - This project's SourceForge.net CVS repository can be checked out - through anonymous (pserver) CVS with the following instruction set. - When prompted for a password for anonymous, simply press the Enter key. - </p> - - <pre class="ddisplay"> -cvs -d:pserver:ano...@cv...:\ -/cvsroot/complement login - </pre> - - <pre class="ddisplay"> -cvs -z3 -d:pserver:ano...@cv...:\ -/cvsroot/complement co complement - </pre> - - <p> - Updates from within the module's directory do not need the -d parameter. - </p> - - <h2 class="lheader">Developer CVS Access via SSH</h2> - - <p> - Only project developers can access the CVS tree via this method. - SSH (either SSH1 or SSH2) must be installed on your client machine. - Substitute developername with the proper values. - Name of module is 'complement' here. Enter your site password when - prompted. - </p> - - <pre class="ddisplay"> -export CVS_RSH=ssh - -cvs -z3 -d:ext:dev...@cv...:\ -/cvsroot/complement co complement - </pre> -</div> -<!--#include file="foot.shtml" --> - </body> -</html> Modified: trunk/WWW/explore/Complement/Content.shtml =================================================================== --- trunk/WWW/explore/Complement/Content.shtml 2006-12-05 18:29:42 UTC (rev 1436) +++ trunk/WWW/explore/Complement/Content.shtml 2006-12-06 12:30:41 UTC (rev 1437) @@ -5,7 +5,8 @@ <a href="Requirements.shtml">Requirements</a><br> <a href="Related.shtml">Related issues</a><br> <a href="Download.shtml">Download</a><br> -<a href="CVS.shtml">CVS</a><br> +<a href="SVN.shtml">Code repository</a><br> +<a href="http://sourceforge.net/projects/complement">Project's page @ SourceForge</a><br> <a href="History.shtml">Project history</a><br> <a href="Developers.shtml">Developers</a><br> <a href="License.shtml">License</a><br> Modified: trunk/WWW/explore/Complement/ContentTech.shtml =================================================================== --- trunk/WWW/explore/Complement/ContentTech.shtml 2006-12-05 18:29:42 UTC (rev 1436) +++ trunk/WWW/explore/Complement/ContentTech.shtml 2006-12-06 12:30:41 UTC (rev 1437) @@ -1,7 +1,8 @@ <!-- Time-stamp: <03/06/29 16:07:20 ptr> --> <div class="nodecor"> <a href="index.shtml">Home</a><br> -<a href="BuildSystem.shtml">Build system</a><br> +<a href="Anti-autotools.shtml">Anti-autotools</a><br> +<a href="MakeTags.shtml">Make system</a><br> <a href="compare.pdf">Comparison of STL<br>Implementations (PDF)</a><br> <br> <a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=63160&type=2" width="125" height="37" border="0" alt="SourceForge.net Logo"></a><br> Added: trunk/WWW/explore/Complement/MakeTags.shtml =================================================================== --- trunk/WWW/explore/Complement/MakeTags.shtml (rev 0) +++ trunk/WWW/explore/Complement/MakeTags.shtml 2006-12-06 12:30:41 UTC (rev 1437) @@ -0,0 +1,139 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<!-- Time-stamp: <03/10/07 15:50:35 ptr> --> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <link rel="stylesheet" type="text/css" href="main.css" media="screen" title="general"> + <link rel="stylesheet" type="text/css" href="decor.css" media="screen" title="general"> + <link rel="stylesheet" type="text/css" href="float.css" media="screen" title="general"> + <title>Complement: Make Tags</title> + </head> + + <body> +<!--#include file="head-tech.shtml" --> +<div class="toppic"> +<img src="img/jpg/apropos.jpg"> +</div> +<div class="main"> + <h2 class="lheader">Make versions</h2> + <p> + I stop on support on two make variants. Well, really on single + GNU Make + and one naive utility (nmake). + </p> + + <p> + GNU Make is everyware (or can be + everyware) in *NIX world. So I don't have stimulus to play with + another make incarnations (for example, BSD make is very nice, + but GNU Make more common). If GNU Make is present, I expect that + other POSIX utilities (sed, awk, sh, grep, cat, test, ... ) + present too. + </p> + + <p> + To play with compilers from one Redmond's company, you may + use nmake. The makefiles less attached to absolute paths, + and really may be moved from one box to another, in contrast + to MS's project files. Even more, VS's projects are castrated makefiles + that processed by nmake; this process screened by GUI from users. + Nmake is really restricted, and system based on it has less + features and power then GNU make-based. But it work too. + </p> + + <h2 class="lheader">Use-case: application</h2> + +<pre class="ddisplay"> +# -*- Makefile -*- Time-stamp: <06/08/04 10:54:19 ptr> + +SRCROOT := ../../.. +COMPILER_NAME := gcc + +include Makefile.inc +include ${SRCROOT}/Makefiles/top.mak + + +INCLUDES += -I$(SRCROOT)/include -I$(BOOST_INCLUDE_DIR) + +release-shared : LDLIBS = -lxmt -lboost_test_utf +stldbg-shared : LDLIBS = -lxmtstlg -lboost_test_utfstlg +dbg-shared : LDLIBS = -lxmtg -lboost_test_utfg +</pre> + +<pre class="ddisplay"> +# -*- makefile -*- Time-stamp: <04/05/06 18:40:56 ptr> + +PRGNAME = mt_ut +SRC_CC = unit_test.cc timespec.cc mutex_test.cc spinlock_test.cc \ + recursive_mutex.cc join.cc signal-1.cc signal-2.cc flck.cc lfs.cc +</pre> + +<pre class="ddisplay"> +# -*- Makefile -*- Time-stamp: <03/10/17 19:42:29 ptr> + +SRCROOT=..\..\.. +COMPILER_NAME=vc6 + +!include Makefile.inc + +INCLUDES=$(INCLUDES) /I "$(SRCROOT)/include" /I "$(STLPORT_INCLUDE_DIR)" /I "$(BOOST_INCLUDE_DIR)" +DEFS = $(DEFS) /D_STLP_USE_DYNAMIC_LIB + +LDSEARCH=/LIBPATH:"$(CoMT_LIB_DIR)" +LDLIBS = xmt_vc6.lib boost_test_utf_vc6s.lib +!include $(SRCROOT)/Makefiles/nmake/top.mak +</pre> + + <h2 class="lheader">Use-case: library</h2> + +<pre class="ddisplay"> +# -*- Makefile -*- Time-stamp: <06/11/10 16:23:01 ptr> + +SRCROOT := ../.. + +include Makefile.inc +include ${SRCROOT}/Makefiles/top.mak + +INCLUDES += -I$(SRCROOT)/include +</pre> + +<pre class="ddisplay"> +# -*- Makefile -*- Time-stamp: <06/11/29 01:59:50 ptr> + +LIBNAME = xmt +MAJOR = 1 +MINOR = 9 +PATCH = 3 +SRC_CC = xmt.cc thr_mgr.cc time.cc uid.cc +SRC_C = fl.c +</pre> + +<pre class="ddisplay"> +# -*- Makefile -*- Time-stamp: <03/09/28 19:14:05 ptr> + +SRCROOT=..\.. +COMPILER_NAME=vc6 + +!include Makefile.inc + +DEFS = /D_STLP_USE_DYNAMIC_LIB +INCLUDES=$(INCLUDES) /I "$(SRCROOT)/include" /I "$(STLPORT_INCLUDE_DIR)" +OPT_STLDBG = /Zm800 +LDSEARCH=$(LDSEARCH) /LIBPATH:$(STLPORT_LIB_DIR) + +!include $(SRCROOT)/Makefiles/nmake/top.mak +</pre> + + <h2 class="lheader">Global settings: configure again?</h2> + <h2 class="lheader">Build tags</h2> +<pre class="ddisplay"> +</pre> + +</div> +<!--#include file="foot.shtml" --> +<!-- Created: Mon Oct 7 16:33:17 MSD 2002 --> + </body> +</html> + Copied: trunk/WWW/explore/Complement/SVN.shtml (from rev 1365, trunk/WWW/explore/Complement/CVS.shtml) =================================================================== --- trunk/WWW/explore/Complement/SVN.shtml (rev 0) +++ trunk/WWW/explore/Complement/SVN.shtml 2006-12-06 12:30:41 UTC (rev 1437) @@ -0,0 +1,47 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<!-- Time-stamp: <03/05/04 20:33:15 ptr> --> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <link rel="stylesheet" type="text/css" href="main.css" media="screen" title="general"> + <link rel="stylesheet" type="text/css" href="decor.css" media="screen" title="general"> + <link rel="stylesheet" type="text/css" href="float.css" media="screen" title="general"> + <title>Complement: Code repository access</title> + </head> + + <body> +<!--#include file="head.shtml" --> +<div class="toppic"> +<img src="img/jpg/cvs.jpg"> +</div> +<div class="main"> + <h2 class="lheader">Information on SF</h2> + + <p> + You can read directives for Subversion repository access either + <a href="http://sourceforge.net/svn/?group_id=63160">on SourceForge page</a> + or below on this page. + </p> + + <h2 class="lheader">Anonymous read-only access</h2> + + <p> + Complement's use Subversion CMS. Repository based on SourceForge. + Anonymous read-only commit: + </p> +<pre class="ddisplay"> +svn co https://complement.svn.sourceforge.net/svnroot/complement/trunk/complement \ + complement +</pre> + <p> + To update (from catalog 'complement', if commit was made as described above) + </p> +<pre class="ddisplay"> +svn update +</pre> +</div> +<!--#include file="foot.shtml" --> + </body> +</html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-05 18:29:46
|
Revision: 1436 http://svn.sourceforge.net/complement/?rev=1436&view=rev Author: complement Date: 2006-12-05 10:29:42 -0800 (Tue, 05 Dec 2006) Log Message: ----------- update documentation: build system, announce, current state of project, requirements; remove garbage Modified Paths: -------------- trunk/WWW/explore/Complement/Content.shtml trunk/WWW/explore/Complement/Requirements.shtml trunk/WWW/explore/Complement/index.shtml Added Paths: ----------- trunk/WWW/explore/Complement/BuildSystem.shtml trunk/WWW/explore/Complement/ContentTech.shtml trunk/WWW/explore/Complement/Technical.shtml trunk/WWW/explore/Complement/compare.pdf trunk/WWW/explore/Complement/head-tech.shtml Removed Paths: ------------- trunk/WWW/explore/Complement/.cvsignore trunk/WWW/explore/Complement/Content-string.shtml trunk/WWW/explore/Complement/head-string.shtml Deleted: trunk/WWW/explore/Complement/.cvsignore =================================================================== --- trunk/WWW/explore/Complement/.cvsignore 2006-12-05 15:38:09 UTC (rev 1435) +++ trunk/WWW/explore/Complement/.cvsignore 2006-12-05 18:29:42 UTC (rev 1436) @@ -1,10 +0,0 @@ -.xvpics -prog.xcf -prog.jpg -Co1.xcf -Co2.xcf -Co-yg1.png -Co-yg1.jpg -Co-ys1.jpg -Co-ydg1.jpg -sample.css Added: trunk/WWW/explore/Complement/BuildSystem.shtml =================================================================== --- trunk/WWW/explore/Complement/BuildSystem.shtml (rev 0) +++ trunk/WWW/explore/Complement/BuildSystem.shtml 2006-12-05 18:29:42 UTC (rev 1436) @@ -0,0 +1,183 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<!-- Time-stamp: <03/10/07 15:50:35 ptr> --> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <link rel="stylesheet" type="text/css" href="main.css" media="screen" title="general"> + <link rel="stylesheet" type="text/css" href="decor.css" media="screen" title="general"> + <link rel="stylesheet" type="text/css" href="float.css" media="screen" title="general"> + <title>Complement: Build System</title> + </head> + + <body> +<!--#include file="head-tech.shtml" --> +<div class="toppic"> +<img src="img/jpg/apropos.jpg"> +</div> +<div class="main"> + <h2 class="lheader">Why I hate autotools</h2> + <dl> + <dt>Myth 1. Autotools isolate programmer from platform software.</dt> + <dd> + Do you ever try to build some real project with autotools (with ./configure) + with some compiler different from gcc? I do. I spent much more time to + say what compiler name I need, what options I need, what options I don't + to see, etc. etc. then for code portability itself! I.e. I spent more + time to boring tools that was intended for screen portabilty problems.<br> + + This problem even worse. Autotools incompatible between versions of autotools. + When automake installed on you system too old for one project, it too new + for another. It's a big luck when only warning happens. + </dd> + + <dt>Myth 2. Autotools help to write portable code.</dt> + + <dd> + The case when platform A has function with name foo, platform B has function with + name boo, that implement the same paradigm as foo on platform A. Programmer + should worry about paradigm difference youself, autotools can't help too much here. + Really I can say: 'my code work on platform A' only if I at least compile + it for platform A. Or at least check the difference between platform A and platform + B, if I know what happens on platform B. Autotools don't magically provide + workarounds for platform A. I, as programmer, should know about platform A speciality, and should + worry about it. + </dd> + + <dt>Myth 3. Autotools provide easy-to-use build system.</dt> + <dd> Well, while you use autotools only to build projects: + +<pre class="ddisplay"> +./configure && make && make install +</pre> + + all fine and you happy. Nice! But if you developer, not all so good: +<pre class="ddisplay"> +autoreconf +... +./configure +... +make +... +Boom! +make clean +... +Boom! +make distclean +... +autoreconf +... +automake +... +./configure +... +make +</pre> + Hmm, I should pass <tt>-DUSE_FEATURE_BOO=2</tt> for program <tt>boo</tt>! +<pre class="ddisplay"> +make distclean; autoreconf && automake && ./configure && make +</pre> + Ufff...<br> + + It very annoying, especially if I know that all this job may be done + within make tool only, without other bloated scripts.<br> + + What about this checks: +<pre class="ddisplay"> +checking for g77... no +checking for f77... no +checking for xlf... no +checking for frt... no +checking for pgf77... no +checking for cf77... no +checking for fort77... no +checking for fl32... no +checking for af77... no +checking for f90... no +checking for xlf90... no +checking for pgf90... no +checking for pghpf... no +checking for epcf90... no +checking for gfortran... no +checking for g95... no +checking for f95... no +checking for fort... no +checking for xlf95... no +checking for ifort... no +checking for ifc... no +checking for efc... no +checking for pgf95... no +checking for lf95... no +checking for ftn... no +checking whether we are using the GNU Fortran 77 compiler... no +</pre> + when I have no fortran code? Note, that this check may be not only annoying, + but block build on insignificant check. + </dd> + </dl> + + Yet another. What you think about pollution by generated file (.o, .la, ...) + in the same place where you source files situated? Can you hide this intermediate + results someware else? I can. Autotools can't. Only with libtool, that + block cross-compilation (it finding native libraries, instead of cross). + + <h2 class="lheader">What instead?</h2> + + <p> + First, let's say that informing about and passing specific configuration options 'configure' + do well. But this not require shell script 700K in size. + </p> + + <p> + Then, we can see that 'make' and friends is very power tool. Just let's allow + do it job well! + </p> + + <p> + You have 'common' flow, i.e. compile object files from C source, link the set of + object files into executable or shared object. And, sometimes, you need original + operations, like generation of C file from some meta-language with some + tool. Build system provide easy suggestion for common tasks, and allow you + do original builds as you want. I.e. build system may worry about transformation + from file.cc to file.o to file.so, take into account dependency and generate + TAGS for emacs. If you don't want here something else, of cause. + </p> + + <p> + As simplest example, I use two files to build <b>xmt</b> library on a wide set of + platforms: + </p> +<pre class="ddisplay"> +# -*- Makefile -*- Time-stamp: <06/11/10 16:23:01 ptr> + +SRCROOT := ../.. + +include Makefile.inc +include ${SRCROOT}/Makefiles/top.mak + +INCLUDES += -I$(SRCROOT)/include +</pre> + <p> + and <tt>Makefile.inc</tt> + </p> +<pre class="ddisplay"> +# -*- Makefile -*- Time-stamp: <06/11/29 01:59:50 ptr> + +LIBNAME = xmt +MAJOR = 1 +MINOR = 9 +PATCH = 3 +SRC_CC = xmt.cc thr_mgr.cc time.cc uid.cc +SRC_C = fl.c +</pre> + <p> + Really first file vary for different compilers (and very different for + Redmond's nmake) but the second (<tt>Makefile.inc</tt>) is one for all. + </p> +</div> +<!--#include file="foot.shtml" --> +<!-- Created: Mon Oct 7 16:33:17 MSD 2002 --> + </body> +</html> + Deleted: trunk/WWW/explore/Complement/Content-string.shtml =================================================================== --- trunk/WWW/explore/Complement/Content-string.shtml 2006-12-05 15:38:09 UTC (rev 1435) +++ trunk/WWW/explore/Complement/Content-string.shtml 2006-12-05 18:29:42 UTC (rev 1436) @@ -1,8 +0,0 @@ -<!-- Time-stamp: <03/10/10 09:02:43 ptr> --> -<!-- $Id$ --> -<div class="nodecor"> -<a href="index.shtml">Complement Home</a><br> -<a href="compare.pdf">Comparison of Strings Implementations in C++ language (PDF)</a><br> -<br> -<a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=63160&type=2" width="125" height="37" border="0" alt="SourceForge.net Logo"></a><br> -</div> Modified: trunk/WWW/explore/Complement/Content.shtml =================================================================== --- trunk/WWW/explore/Complement/Content.shtml 2006-12-05 15:38:09 UTC (rev 1435) +++ trunk/WWW/explore/Complement/Content.shtml 2006-12-05 18:29:42 UTC (rev 1436) @@ -1,7 +1,7 @@ <!-- Time-stamp: <03/06/29 16:07:20 ptr> --> -<!-- $Id$ --> <div class="nodecor"> <a href="index.shtml">Home</a><br> +<a href="Technical.shtml">Architecture, specifications,<br> technical descriptions</a><br> <a href="Requirements.shtml">Requirements</a><br> <a href="Related.shtml">Related issues</a><br> <a href="Download.shtml">Download</a><br> Added: trunk/WWW/explore/Complement/ContentTech.shtml =================================================================== --- trunk/WWW/explore/Complement/ContentTech.shtml (rev 0) +++ trunk/WWW/explore/Complement/ContentTech.shtml 2006-12-05 18:29:42 UTC (rev 1436) @@ -0,0 +1,9 @@ +<!-- Time-stamp: <03/06/29 16:07:20 ptr> --> +<div class="nodecor"> +<a href="index.shtml">Home</a><br> +<a href="BuildSystem.shtml">Build system</a><br> +<a href="compare.pdf">Comparison of STL<br>Implementations (PDF)</a><br> +<br> +<a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=63160&type=2" width="125" height="37" border="0" alt="SourceForge.net Logo"></a><br> +</div> +<!-- Created: Mon Oct 7 17:32:53 MSD 2002 --> Modified: trunk/WWW/explore/Complement/Requirements.shtml =================================================================== --- trunk/WWW/explore/Complement/Requirements.shtml 2006-12-05 15:38:09 UTC (rev 1435) +++ trunk/WWW/explore/Complement/Requirements.shtml 2006-12-05 18:29:42 UTC (rev 1436) @@ -1,7 +1,6 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!-- Time-stamp: <03/05/04 21:08:11 ptr> --> -<!-- $Id$ --> <html> <head> @@ -18,7 +17,46 @@ <img src="img/jpg/c++.jpg"> </div> <div class="main"> - <h2 class="lheader">Platforms and Compilers</h2> + <h2 class="lheader">About portability</h2> + <p>Project was started as cross-platform with two main target platforms: few *nixes and Windows. + But now I lost interest to Windows. Of cause, I don't remove code for Windows + specially, but I don't check code on Windows platform and don't worry about Windows when writing new code + during long time. But margine of code is enough, so this support may be added, + if somebody would want use this project under Redmond's OS. + </p> + + <h2 class="lheader">Platforms and Compilers, current state</h2> + <p>My primary platform is Linux, but I made few efforts to suport FreeBSD. + </p> + + <p>Well, in code I mentioned NetBSD and OpenBSD, but due to restrictions in + threads implementation on this platforms, I'm expect problems here. + </p> + + <p>Really, I don't see blocking problems to use libraries from this project + on any POSIX-compliant OS, that has good threads implementation. + </p> + + <p>The same words applicable to compilers: now I use gcc 4.x, but 3.4 enough too + or any other compiler, that implement modern C++ (near ISO/IEC 14882:2003 + standard). + </p> + + <p>Other useful tools are not beyond the normal POSIX system tools, except Make: + I'm expect GNU make 3.80 or better. Not too strong requirement for *nixes. + </p> + + <p>In the past Complement work only with <a href="http://stlport.sourceforge.net">STLport</a> STL implementation. Now + it may use any modern STL (libstdc++ in particular). + </p> + + <p>Unit tests use <a href="http://www.boost.org/libs/test/doc/components/utf/">Boost Unit Test Framework</a>. + </p> + + <h2 class="lheader">Platforms and Compilers, historical</h2> + + <p>Really + </p> <p> Libraries worked with following platforms and C++ compilers: </p> @@ -45,7 +83,7 @@ </table> </center> - <h2 class="lheader">Other requirements</h2> + <h2 class="lheader">Other requirements, historical</h2> <ul> <li>GNU make v. 3.79.1 (for Unix-like platforms);</li> @@ -55,7 +93,7 @@ and early 3.x releases; 2.96, that shipout with RedHat, IMHO isn't good choice too); </li> - <li><a href="http://www.stlport.org">STLport</a>---STL implementation. + <li><a href="http://stlport.sourceforge.net">STLport</a>---STL implementation. Very efficient, very portable STL implementation. Instead of have troubles with different (and sometimes ugly) STL implementations that come with C++ compilers, I use STLport. Added: trunk/WWW/explore/Complement/Technical.shtml =================================================================== --- trunk/WWW/explore/Complement/Technical.shtml (rev 0) +++ trunk/WWW/explore/Complement/Technical.shtml 2006-12-05 18:29:42 UTC (rev 1436) @@ -0,0 +1,26 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<!-- Time-stamp: <03/10/07 15:50:35 ptr> --> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <link rel="stylesheet" type="text/css" href="main.css" media="screen" title="general"> + <link rel="stylesheet" type="text/css" href="decor.css" media="screen" title="general"> + <link rel="stylesheet" type="text/css" href="float.css" media="screen" title="general"> + <title>Complement: Build System</title> + </head> + + <body> +<!--#include file="head-tech.shtml" --> +<div class="toppic"> +<img src="img/jpg/apropos.jpg"> +</div> +<div class="main"> + <h2 class="lheader">Technology</h2> +</div> +<!--#include file="foot.shtml" --> +<!-- Created: Mon Oct 7 16:33:17 MSD 2002 --> + </body> +</html> + Added: trunk/WWW/explore/Complement/compare.pdf =================================================================== (Binary files differ) Property changes on: trunk/WWW/explore/Complement/compare.pdf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/WWW/explore/Complement/head-string.shtml =================================================================== --- trunk/WWW/explore/Complement/head-string.shtml 2006-12-05 15:38:09 UTC (rev 1435) +++ trunk/WWW/explore/Complement/head-string.shtml 2006-12-05 18:29:42 UTC (rev 1436) @@ -1,10 +0,0 @@ -<!-- Time-stamp: <03/10/07 15:48:03 ptr> --> -<!-- $Id$ --> - -<div class="logo1 margines20"><img src="img/jpg/Co-yw1.jpg"></div> -<div class="rightfloat"> - <div class="logo2 margines20"><!-- <img src="img/png/ermine.png"> --></div> - <div class="toc"> -<!--#include file="Content-string.shtml" --> - </div> <!-- toc --> -</div> <!-- rightfloat --> Added: trunk/WWW/explore/Complement/head-tech.shtml =================================================================== --- trunk/WWW/explore/Complement/head-tech.shtml (rev 0) +++ trunk/WWW/explore/Complement/head-tech.shtml 2006-12-05 18:29:42 UTC (rev 1436) @@ -0,0 +1,9 @@ +<!-- Time-stamp: <03/05/04 16:12:38 ptr> --> + +<div class="logo1 margines20"><img src="img/jpg/Co-yw1.jpg"></div> +<div class="rightfloat"> + <div class="logo2 margines20"><!-- <img src="img/png/ermine.png"> --></div> + <div class="toc"> +<!--#include file="ContentTech.shtml" --> + </div> <!-- toc --> +</div> <!-- rightfloat --> Modified: trunk/WWW/explore/Complement/index.shtml =================================================================== --- trunk/WWW/explore/Complement/index.shtml 2006-12-05 15:38:09 UTC (rev 1435) +++ trunk/WWW/explore/Complement/index.shtml 2006-12-05 18:29:42 UTC (rev 1436) @@ -50,35 +50,35 @@ Generic interface for interprocess communication via sockets. Sockios programming interface unified with C++ standard (ISO/IEC 14882) IO streams interface. Provide easy and evident (for C++ programmer, - who understand STL) interface for TCP socket: framework both for client - and server parts. + who understand STL) interface for TCP sockets: framework both for client + and server parts. Generic server implemented with use of <b>xmt</b> library. </dd> <dt>StEM</dt> <dd> - StEM is finite state machine, released as set of objects with - state and interaction via events. It used as framework for - asynchronous events delivery and processing. - Every node has a stack of states and may react on incoming - events (depends upon event processing handlers and state). - Behaviour of object may vary during it's life time. - Communication - with events in StEM framework possible as within single process, - as between different processes (wold-wide too), over TCP - (framework provided by libsockios). In contrast to similar frameworks, - to process StEM-designed code you need only C++ compiler. + StEM is a C++ framework to build application as finite state, + event-driven machine. Machine correspond to set of independent objects, + each with own state and state history, that may interact via events. + Objects may be situated in different processes (that may be running on different + hosts, connected via TCP network). Framework use asynchronous events delivery + and processing.<br><br> + + Every node (object) has a stack of states and may react on incoming + events (depends upon event processing handlers, state and states history). + Behaviour of object may vary during it's life time (via change of it state).<br><br> + + StEM follow code reuse principles: it use <b>xmt</b> and <b>sockios</b> internal + and external communication.<br><br> + + In contrast to similar frameworks, + to build application based on StEM framework, you need only C++ compiler. </dd> </dl> <h2 class="lheader">Present State of Complement Project</h2> <p> - Active development for Unix-like systems - (now Linux, some time ago it was Solaris, HP-UX, Windows). - Supported compilers---all modern gcc (begin from 2.95.3, but better - 3.4.x or 4.x). Work well with STLport 5.x. - Different versions and parts of this system was used on Windows - (95, 98, NT, 2000, XP) with VC++ 5 SP3, HP-UX 11.00 (HP aCC A.03.13), - Solaris (SunSoft CC 5.2), FreeBSD, Linux (glibc and uClibc). + Since 1996 few projects was implemented with this libraries (it's not frozen, it under development). + See <a href="Requirements.shtml">Requirements</a>. </p> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-05 15:38:18
|
Revision: 1435 http://svn.sourceforge.net/complement/?rev=1435&view=rev Author: complement Date: 2006-12-05 07:38:09 -0800 (Tue, 05 Dec 2006) Log Message: ----------- remove obsolete and incomplete string-compare in HTML Modified Paths: -------------- trunk/WWW/explore/Complement/Content-string.shtml Removed Paths: ------------- trunk/WWW/explore/Complement/string-compare.shtml Modified: trunk/WWW/explore/Complement/Content-string.shtml =================================================================== --- trunk/WWW/explore/Complement/Content-string.shtml 2006-12-04 16:38:50 UTC (rev 1434) +++ trunk/WWW/explore/Complement/Content-string.shtml 2006-12-05 15:38:09 UTC (rev 1435) @@ -2,7 +2,6 @@ <!-- $Id$ --> <div class="nodecor"> <a href="index.shtml">Complement Home</a><br> -<a href="string-compare.shtml">Comparison of Strings Implementations in C++ language</a><br> <a href="compare.pdf">Comparison of Strings Implementations in C++ language (PDF)</a><br> <br> <a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=63160&type=2" width="125" height="37" border="0" alt="SourceForge.net Logo"></a><br> Deleted: trunk/WWW/explore/Complement/string-compare.shtml =================================================================== --- trunk/WWW/explore/Complement/string-compare.shtml 2006-12-04 16:38:50 UTC (rev 1434) +++ trunk/WWW/explore/Complement/string-compare.shtml 2006-12-05 15:38:09 UTC (rev 1435) @@ -1,75 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> - -<!-- Time-stamp: <03/10/07 16:16:39 ptr> --> -<!-- $Id$ --> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <link rel="stylesheet" type="text/css" href="main.css" media="screen" title="general"> - <link rel="stylesheet" type="text/css" href="decor.css" media="screen" title="general"> - <link rel="stylesheet" type="text/css" href="float.css" media="screen" title="general"> - <title>C++ string implementation performance</title> - </head> - - <body> -<!--#include file="head-string.shtml" --> -<div class="toppic"> -<img src="img/jpg/apropos.jpg"> -</div> -<div class="main"> - <!-- <h2 class="lheader">Related links</h2> --> - -<h2 class="lheader"><font size="+2">Comparison of Strings Implementations in C++ language</font></h2> - by Petr Ovchenkov - -<h2 class="lheader">Abstract</h2> -<p> -<i> -In this article I present attempt to made comparison of strings implementation -in STLport and GNU libstd++. -Also I want to show results that can help to answer on question: what better -from practice point of view, constant or linear complexity of strings copy algorithm? This comparison is done on the base of STLport strings and ropes. -I expect that this results will help to make decision between STL implementations -as well proper choice of strings implementation. -</i> -</p> - -<h2 class="lheader">1. Computers</h2> -<p>Computers and operational environments that used in tests:</p> -<ul> - <li>Hands-made machine (assembled by <a href="http://www.tersys.ru">Tersys company</a>) with 2 1.33-GHz AMD - Athlon XP 1500+ processors under Linux (kernel 2.4.20, glibc 2.2.5). - </li> -</ul> - -<h2 class="lheader">2. Compilers</h2> -<p> -For Unix-like systems was used GNU gcc 3.3 with appropriate libstd++ libraries -(version 3). The GNU gcc 3.1.1 and 3.2.3 are worse up to 28% (for some tests). -</p> - -<h2 class="lheader">3. Time Measure</h2> -<p> -Due to “time” function has different options and output format on Linux and other -UINIXes, I use program time from <a href="index.shtml">complement project bundle</a>. By the way this function provide high-precision time measure. -</p> - -<h2 class="lheader">4. Statistic</h2> -<p> -Every experiment repeate 10 times. For every result series I do ordinal statistical manipulation. Mean time is -</p> - -<p> -And mean square deviation -</p> - -<p> -or -</p> - -</div> -<!--#include file="foot.shtml" --> - </body> -</html> - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-04 16:41:40
|
Revision: 1433 http://svn.sourceforge.net/complement/?rev=1433&view=rev Author: complement Date: 2006-12-04 08:37:24 -0800 (Mon, 04 Dec 2006) Log Message: ----------- Complement snapshot, 2006-12-04 Added Paths: ----------- tags/complement-20061204/ Copied: tags/complement-20061204 (from rev 1432, trunk/complement) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-04 16:41:39
|
Revision: 1434 http://svn.sourceforge.net/complement/?rev=1434&view=rev Author: complement Date: 2006-12-04 08:38:50 -0800 (Mon, 04 Dec 2006) Log Message: ----------- no needs more Removed Paths: ------------- tags/complement-20061201/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-04 16:16:45
|
Revision: 1432 http://svn.sourceforge.net/complement/?rev=1432&view=rev Author: complement Date: 2006-12-04 08:16:38 -0800 (Mon, 04 Dec 2006) Log Message: ----------- remove global address to internal address heap; use global address to transport instead [with a bit comlpicated target structure---local id added] Modified Paths: -------------- trunk/complement/explore/include/stem/EvManager.h trunk/complement/explore/lib/stem/ChangeLog trunk/complement/explore/lib/stem/EvManager.cc trunk/complement/explore/lib/stem/Names.cc Modified: trunk/complement/explore/include/stem/EvManager.h =================================================================== --- trunk/complement/explore/include/stem/EvManager.h 2006-12-01 15:17:00 UTC (rev 1431) +++ trunk/complement/explore/include/stem/EvManager.h 2006-12-04 16:16:38 UTC (rev 1432) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/11/30 22:33:25 ptr> +// -*- C++ -*- Time-stamp: <06/12/04 17:32:31 ptr> /* * Copyright (c) 1995-1999, 2002, 2003, 2005, 2006 @@ -79,14 +79,13 @@ typedef std::map<addr_type,EventHandler *> local_heap_type; typedef std::map<addr_type,std::string> info_heap_type; - typedef std::map<gaddr_type,addr_type> uuid_ext_heap_type; typedef std::map<addr_type,gaddr_type> ext_uuid_heap_type; - typedef std::multimap<gaddr_type,detail::transport> uuid_tr_heap_type; + typedef std::multimap<gaddr_type,std::pair<addr_type,detail::transport> > uuid_tr_heap_type; typedef std::multimap<detail::transport_entry,gaddr_type> tr_uuid_heap_type; - static bool tr_compare( const std::pair<gaddr_type,detail::transport>& l, const std::pair<gaddr_type,detail::transport>& r ) - { return l.second < r.second; } + static bool tr_compare( const std::pair<gaddr_type,std::pair<addr_type,detail::transport> >& l, const std::pair<gaddr_type,std::pair<addr_type,detail::transport> >& r ) + { return l.second.second < r.second.second; } public: @@ -229,9 +228,8 @@ local_heap_type heap; // address -> EventHandler * info_heap_type iheap; // address -> info string (both local and external) - uuid_ext_heap_type _ui_heap; // gloabal address -> address ext_uuid_heap_type _ex_heap; // address -> global address - uuid_tr_heap_type _tr_heap; // global address -> transport + uuid_tr_heap_type _tr_heap; // global address -> address, transport tr_uuid_heap_type _ch_heap; // transport channel -> global address queue_type in_ev_queue; Modified: trunk/complement/explore/lib/stem/ChangeLog =================================================================== --- trunk/complement/explore/lib/stem/ChangeLog 2006-12-01 15:17:00 UTC (rev 1431) +++ trunk/complement/explore/lib/stem/ChangeLog 2006-12-04 16:16:38 UTC (rev 1432) @@ -1,3 +1,12 @@ +2006-12-04 Petr Ovtchenkov <pt...@is...> + + * EvManager.h, EvManager.cc, Names.cc: remove global + address to internal address heap; use global address + to transport instead [with a bit comlpicated target + structure---local id added]; this resolve problems + with mapping external objects to local address when + few channels to remote system present. + 2006-11-30 Petr Ovtchenkov <pt...@is...> * Event.h: code clean; change specialization of Event_base Modified: trunk/complement/explore/lib/stem/EvManager.cc =================================================================== --- trunk/complement/explore/lib/stem/EvManager.cc 2006-12-01 15:17:00 UTC (rev 1431) +++ trunk/complement/explore/lib/stem/EvManager.cc 2006-12-04 16:16:38 UTC (rev 1432) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/11/30 22:27:43 ptr> +// -*- C++ -*- Time-stamp: <06/12/04 19:08:21 ptr> /* * @@ -119,7 +119,6 @@ gaddr.hid = xmt::hostid(); gaddr.pid = xmt::getpid(); gaddr.addr = id; - _ui_heap[gaddr] = id; } Locker lk( _lock_iheap ); @@ -131,26 +130,7 @@ __FIT_DECLSPEC addr_type EvManager::Subscribe( EventHandler *object, const char *info ) { - addr_type id; - { - Locker _x1( _lock_heap ); - id = create_unique(); - heap[id] = object; - } - { - Locker lk( _lock_xheap ); - gaddr_type& gaddr = _ex_heap[id]; - gaddr.hid = xmt::hostid(); - gaddr.pid = xmt::getpid(); - gaddr.addr = id; - _ui_heap[gaddr] = id; - } - if ( info ) { - Locker _x1( _lock_iheap ); - iheap[id] = info; - } - - return id; + return info ? Subscribe( object, string(info) ) : Subscribe( object, string() ); } __FIT_DECLSPEC @@ -172,7 +152,6 @@ gaddr.hid = xmt::hostid(); gaddr.pid = xmt::getpid(); gaddr.addr = id; - _ui_heap[gaddr] = id; } Locker _x1( _lock_iheap ); @@ -185,29 +164,7 @@ addr_type EvManager::SubscribeID( addr_type id, EventHandler *object, const char *info ) { - if ( (id & extbit) ) { - return badaddr; - } else { - Locker _x1( _lock_heap ); - if ( unsafe_is_avail( id ) ) { - return badaddr; - } - heap[id] = object; - } - { - Locker lk( _lock_xheap ); - gaddr_type& gaddr = _ex_heap[id]; - gaddr.hid = xmt::hostid(); - gaddr.pid = xmt::getpid(); - gaddr.addr = id; - _ui_heap[gaddr] = id; - } - if ( info ) { - Locker _x1( _lock_iheap ); - iheap[id] = info; - } - - return id; + return info ? SubscribeID( id, object, string(info) ) : SubscribeID( id, object, string() ); } __FIT_DECLSPEC @@ -220,8 +177,7 @@ Locker _x1( _lock_xheap ); id = create_unique_x(); _ex_heap[id] = addr; - _ui_heap[addr] = id; - _tr_heap.insert( make_pair( addr, tr ) ); + _tr_heap.insert( make_pair( addr, make_pair( id, tr ) ) ); _ch_heap.insert( make_pair( tr.link, addr ) ); } { @@ -237,21 +193,7 @@ const gaddr_type& addr, const char *info ) { - addr_type id; - { - Locker _x1( _lock_xheap ); - id = create_unique_x(); - _ex_heap[id] = addr; - _ui_heap[addr] = id; - _tr_heap.insert( make_pair( addr, tr ) ); - _ch_heap.insert( make_pair( tr.link, addr ) ); - } - if ( info ) { - Locker _x1( _lock_iheap ); - iheap[id] = info; - } - - return id; + return info ? SubscribeRemote( tr, addr, string(info) ) : SubscribeRemote( tr, addr, string() ); } __FIT_DECLSPEC @@ -262,10 +204,9 @@ if ( addr.hid == xmt::hostid() && addr.pid == xmt::getpid() ) { // local if ( addr.addr & extbit ) { // may be transit object Locker lk( _lock_xheap ); - uuid_ext_heap_type::const_iterator i = _ui_heap.find( addr ); - - if ( i != _ui_heap.end() ) { - return i->second; + pair<uuid_tr_heap_type::const_iterator,uuid_tr_heap_type::const_iterator> range = _tr_heap.equal_range( addr ); + if ( range.first != range.second ) { // transport present + return min_element( range.first, range.second, tr_compare )->second.first; } } else { // may be local object Locker lk( _lock_heap ); @@ -277,11 +218,11 @@ return badaddr; // don't know what I can made } else { // foreign object Locker lk( _lock_xheap ); - uuid_ext_heap_type::const_iterator i = _ui_heap.find( addr ); - - if ( i != _ui_heap.end() ) { - return i->second; + pair<uuid_tr_heap_type::const_iterator,uuid_tr_heap_type::const_iterator> tr_range = _tr_heap.equal_range( addr ); + if ( tr_range.first != tr_range.second ) { // transport present + return min_element( tr_range.first, tr_range.second, tr_compare )->second.first; } + gaddr_type peer_zero( addr ); peer_zero.addr = default_addr; pair<uuid_tr_heap_type::const_iterator,uuid_tr_heap_type::const_iterator> range = _tr_heap.equal_range( peer_zero ); @@ -290,11 +231,10 @@ } id = create_unique_x(); for ( uuid_tr_heap_type::const_iterator j = range.first; j != range.second; ++j ) { - _tr_heap.insert( make_pair( addr, j->second ) ); // all available transports - _ch_heap.insert( make_pair( j->second.link, addr ) ); + _tr_heap.insert( make_pair( addr, make_pair( id, j->second.second ) ) ); // all available transports + _ch_heap.insert( make_pair( j->second.second.link, addr ) ); } _ex_heap[id] = addr; - _ui_heap[addr] = id; } { Locker lk( _lock_iheap ); @@ -307,49 +247,7 @@ addr_type EvManager::SubscribeRemote( const gaddr_type& addr, const char *info ) { - addr_type id; - if ( addr.hid == xmt::hostid() && addr.pid == xmt::getpid() ) { - if ( addr.addr & extbit ) { // may be transit object - Locker lk( _lock_xheap ); - uuid_ext_heap_type::const_iterator i = _ui_heap.find( addr ); - - if ( i != _ui_heap.end() ) { - return i->second; - } - } else { // may be local object - Locker lk( _lock_heap ); - local_heap_type::const_iterator i = heap.find( addr.addr ); - if ( i != heap.end() ) { - return i->first; - } - } - return badaddr; // don't know what I can made - } else { - Locker lk( _lock_xheap ); - uuid_ext_heap_type::const_iterator i = _ui_heap.find( addr ); - - if ( i != _ui_heap.end() ) { - return i->second; - } - gaddr_type peer_zero( addr ); - peer_zero.addr = default_addr; - pair<uuid_tr_heap_type::const_iterator,uuid_tr_heap_type::const_iterator> range = _tr_heap.equal_range( peer_zero ); - if ( range.first == range.second ) { // no transport - return badaddr; - } - id = create_unique_x(); - for ( uuid_tr_heap_type::const_iterator j = range.first; j != range.second; ++j ) { - _tr_heap.insert( make_pair( addr, j->second ) ); // all available transports - _ch_heap.insert( make_pair( j->second.link, addr ) ); - } - _ex_heap[id] = addr; - _ui_heap[addr] = id; - } - if ( info ) { - Locker _x1( _lock_iheap ); - iheap[id] = info; - } - return id; + return info ? SubscribeRemote( addr, string(info) ) : SubscribeRemote( addr, string() ); } __FIT_DECLSPEC @@ -360,8 +258,8 @@ gaddr_type& addr = _ex_heap[id]; pair<uuid_tr_heap_type::iterator,uuid_tr_heap_type::iterator> range = _tr_heap.equal_range( addr ); - for ( uuid_tr_heap_type::iterator i = range.first; i != range.second; ++i ) { - pair<tr_uuid_heap_type::iterator,tr_uuid_heap_type::iterator> ch_range = _ch_heap.equal_range( i->second.link ); + for ( uuid_tr_heap_type::iterator i = range.first; i != range.second; ) { + pair<tr_uuid_heap_type::iterator,tr_uuid_heap_type::iterator> ch_range = _ch_heap.equal_range( i->second.second.link ); for ( tr_uuid_heap_type::iterator j = ch_range.first; j != ch_range.second; ) { if ( j->second == i->first ) { _ch_heap.erase( j++ ); @@ -369,9 +267,12 @@ } ++j; } + if ( i->second.first == id ) { + _tr_heap.erase( i++ ); + continue; + } + ++i; } - _tr_heap.erase( range.first, range.second ); - _ui_heap.erase( addr ); _ex_heap.erase( id ); } else { Locker _x1( _lock_heap ); @@ -416,11 +317,11 @@ #endif Locker _x1( _lock_xheap ); - uuid_ext_heap_type::const_iterator i = _ui_heap.find( addr ); - if ( i == _ui_heap.end() ) { - return badaddr; + pair<uuid_tr_heap_type::const_iterator,uuid_tr_heap_type::const_iterator> range = _tr_heap.equal_range( addr ); + if ( range.first != range.second ) { // transport present + return min_element( range.first, range.second, tr_compare )->second.first; } - return i->second; + return badaddr; } __FIT_DECLSPEC @@ -469,11 +370,16 @@ { pair<tr_uuid_heap_type::iterator,tr_uuid_heap_type::iterator> ch_range = _ch_heap.equal_range( channel ); for (tr_uuid_heap_type::iterator i = ch_range.first; i != ch_range.second; ++i ) { - _tr_heap.erase( i->second ); - addr_type address = _ui_heap[i->second]; - _ex_heap.erase( address ); - iheap.erase( address ); - _ui_heap.erase( i->second ); + pair<uuid_tr_heap_type::iterator,uuid_tr_heap_type::iterator> range = _tr_heap.equal_range( i->second ); + for ( uuid_tr_heap_type::iterator j = range.first; j != range.second; ) { + if ( j->second.second.link == channel ) { + _ex_heap.erase( j->second.first ); + iheap.erase( j->second.first ); + _tr_heap.erase( j++ ); + continue; + } + ++j; + } } _ch_heap.erase( ch_range.first, ch_range.second ); } @@ -490,7 +396,7 @@ if ( range.first == _tr_heap.end() ) { throw range_error( string( "no transport" ) ); } - return min_element( range.first, range.second, tr_compare )->second; + return min_element( range.first, range.second, tr_compare )->second.second; } throw range_error( string( "internal address" ) ); } @@ -518,7 +424,7 @@ if ( range.first == _tr_heap.end() ) { throw range_error( string( "no transport" ) ); } - const detail::transport& tr = min_element( range.first, range.second, tr_compare )->second; + const detail::transport& tr = min_element( range.first, range.second, tr_compare )->second.second; detail::transport::kind_type k = tr.kind; void *link = tr.link; gaddr_type gaddr_dst( i->second ); @@ -531,7 +437,6 @@ _gaddr_src.pid = xmt::getpid(); _gaddr_src.addr = e.src(); // it may be as local as foreign; if e.src() // is foreign, the object is 'transit object' - _ui_heap[_gaddr_src] = e.src(); gaddr_src = _gaddr_src; } else { gaddr_src = j->second; @@ -771,11 +676,6 @@ s << i->first << "\t=> '" << i->second << "'\n"; } - s << "\nUnique Id map:\n"; - for ( uuid_ext_heap_type::const_iterator i = _ui_heap.begin(); i != _ui_heap.end(); ++i ) { - s << i->first << "\t=> " << hex << showbase << i->second << "\n"; - } - s << "\nExternal address map:\n"; for ( ext_uuid_heap_type::const_iterator i = _ex_heap.begin(); i != _ex_heap.end(); ++i ) { s << hex << showbase << i->first << "\t=> " << i->second << "\n"; @@ -783,7 +683,7 @@ s << "\nUnique Id to transport map:\n"; for ( uuid_tr_heap_type::const_iterator i = _tr_heap.begin(); i != _tr_heap.end(); ++i ) { - s << i->first << "\t=> " << i->second.link << " " << i->second.metric << "\n"; + s << i->first << "\t=> " << hex << i->second.first << " " << i->second.second.link << " " << dec << i->second.second.metric << "\n"; } s << "\nTransport to Unique Id map:\n"; Modified: trunk/complement/explore/lib/stem/Names.cc =================================================================== --- trunk/complement/explore/lib/stem/Names.cc 2006-12-01 15:17:00 UTC (rev 1431) +++ trunk/complement/explore/lib/stem/Names.cc 2006-12-04 16:16:38 UTC (rev 1432) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/11/30 19:02:51 ptr> +// -*- C++ -*- Time-stamp: <06/12/04 18:43:56 ptr> /* * Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 @@ -58,14 +58,15 @@ Event_base<Seq> rs( EV_STEM_NS_LIST ); Seq::container_type& lst = rs.value().container; + EvManager::ext_uuid_heap_type::const_iterator j; + manager()->_lock_xheap.lock(); manager()->_lock_iheap.lock(); - for ( EvManager::uuid_ext_heap_type::const_iterator i = manager()->_ui_heap.begin(); i != manager()->_ui_heap.end(); ++i ) { - EvManager::info_heap_type::const_iterator j = manager()->iheap.find( i->second ); - if ( j != manager()->iheap.end() ) { - lst.push_back( make_pair( i->first, j->second ) ); - } else { - lst.push_back( make_pair( i->first, string() ) ); + for ( EvManager::info_heap_type::const_iterator i = manager()->iheap.begin(); i != manager()->iheap.end(); ++i ) { + + j = manager()->_ex_heap.find( i->first ); + if ( j != manager()->_ex_heap.end() ) { + lst.push_back( make_pair( j->second, i->second ) ); } } manager()->_lock_iheap.unlock(); @@ -81,25 +82,18 @@ Event_base<Seq> rs( EV_STEM_NS_NAME ); Seq::container_type& lst = rs.value().container; + manager()->_lock_xheap.lock(); manager()->_lock_iheap.lock(); for ( EvManager::info_heap_type::const_iterator i = manager()->iheap.begin(); i != manager()->iheap.end(); ++i ) { if ( i->second == rq.value() ) { - if ( i->first & extbit /* true */ ) { - Locker lk( manager()->_lock_xheap ); - EvManager::ext_uuid_heap_type::const_iterator j = manager()->_ex_heap.find( i->first ); - if ( j != manager()->_ex_heap.end() ) { - lst.push_back( make_pair( j->second, i->second ) ); - } - } else { - Locker lk( manager()->_lock_heap ); - EvManager::local_heap_type::const_iterator j = manager()->heap.find( i->first ); - if ( j != manager()->heap.end() ) { - lst.push_back( make_pair( gaddr_type(xmt::hostid(), xmt::getpid(), j->first ), i->second ) ); - } + EvManager::ext_uuid_heap_type::const_iterator j = manager()->_ex_heap.find( i->first ); + if ( j != manager()->_ex_heap.end() ) { + lst.push_back( make_pair( j->second, i->second ) ); } } } manager()->_lock_iheap.unlock(); + manager()->_lock_xheap.unlock(); rs.dest( rq.src() ); Send( rs ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-01 15:17:02
|
Revision: 1431 http://svn.sourceforge.net/complement/?rev=1431&view=rev Author: complement Date: 2006-12-01 07:17:00 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Complement's snapshot 2006-12-01 Added Paths: ----------- tags/complement-20061201/ Copied: tags/complement-20061201 (from rev 1430, trunk/complement) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-01 09:37:51
|
Revision: 1430 http://svn.sourceforge.net/complement/?rev=1430&view=rev Author: complement Date: 2006-12-01 01:37:47 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Removed Paths: ------------- tags/complement-20061201/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2006-12-01 09:37:27
|
Revision: 1429 http://svn.sourceforge.net/complement/?rev=1429&view=rev Author: complement Date: 2006-12-01 01:36:36 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Added Paths: ----------- tags/complement-20061201/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |