complement-svn Mailing List for Complement (Page 20)
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...> - 2007-02-01 17:24:53
|
Revision: 1503 http://svn.sourceforge.net/complement/?rev=1503&view=rev Author: complement Date: 2007-02-01 09:24:46 -0800 (Thu, 01 Feb 2007) Log Message: ----------- start connect_processor threads only from 'observer' thread; threads pool managed only from 'observer' thread; 'observer' thread not in threads pool, it start from 'loop'; libsockios: Version 1.10.4 Modified Paths: -------------- trunk/complement/explore/include/sockios/sockmgr.cc trunk/complement/explore/include/sockios/sockmgr.h trunk/complement/explore/lib/sockios/ChangeLog trunk/complement/explore/lib/sockios/Makefile.inc Modified: trunk/complement/explore/include/sockios/sockmgr.cc =================================================================== --- trunk/complement/explore/include/sockios/sockmgr.cc 2007-02-01 17:23:03 UTC (rev 1502) +++ trunk/complement/explore/include/sockios/sockmgr.cc 2007-02-01 17:24:46 UTC (rev 1503) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/02/01 10:04:23 ptr> +// -*- C++ -*- Time-stamp: <07/02/01 19:50:14 ptr> /* * Copyright (c) 1997-1999, 2002, 2003, 2005-2007 @@ -321,48 +321,31 @@ _Self_type *me = static_cast<_Self_type *>(p); me->loop_id.pword( _idx ) = me; // push pointer to self for signal processing xmt::Thread::ret_code rtc; + xmt::Thread::ret_code rtc_observer; rtc.iword = 0; + rtc_observer.iword = 0; + xmt::Thread thr_observer; + try { me->_loop_cnd.set( true ); me->_follow = true; - me->_observer_run = false; while ( (me->*me->_accept)() ) { - if ( me->mgr.size() < 2 ) { - me->mgr.launch( connect_processor, me ); + if ( thr_observer.bad() ) { + if ( thr_observer.is_join_req() ) { + rtc_observer = thr_observer.join(); + if ( rtc_observer.iword != 0 ) { + rtc.iword = -2; // there was connect_processor that was killed + } + } + thr_observer.launch( observer, me, 0, PTHREAD_STACK_MIN * 2 ); } - me->_orlock.lock(); - if ( !me->_observer_run ) { - me->_observer_run = true; - me->_orlock.unlock(); - me->mgr.launch( observer, me, 0, 0, PTHREAD_STACK_MIN * 2 ); - } else { - me->_orlock.unlock(); - } } } catch ( ... ) { - 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(); - - me->_M_c.clear(); // FIN still may not come yet; forse close - - return rtc; - // throw; } xmt::block_signal( SIGINT ); @@ -381,11 +364,13 @@ ::close( me->_pfd[1].fd ); me->close(); // me->_c_lock.unlock(); + rtc_observer = thr_observer.join(); - me->mgr.join(); + me->_M_c.clear(); // FIN still may not come yet; force close + if ( rtc_observer.iword != 0 && rtc.iword == 0 ) { + rtc.iword = -2; // there was connect_processor that was killed + } - me->_M_c.clear(); // FIN still may not come yet; forse close - return rtc; } @@ -464,6 +449,7 @@ } while ( me->_is_follow() && idle_count < 2 ); } catch ( ... ) { + rtc.iword = -1; } return rtc; @@ -487,6 +473,10 @@ std::fill( pool_size, pool_size + 3, 0 ); try { + xmt::ThreadMgr mgr; + + mgr.launch( connect_processor, me /* , 0, 0, PTHREAD_STACK_MIN * 2 */ ); + do { // std::swap( pool_size[0], pool_size[1] ); std::rotate( pool_size, pool_size, pool_size + 3 ); @@ -496,37 +486,45 @@ tpop = me->_tpop; } if ( pool_size[2] != 0 ) { - if ( me->_thr_limit > me->mgr.size() ) { + if ( me->_thr_limit > mgr.size() ) { if ( (pool_size[0] - 2 * pool_size[1] + pool_size[2]) > 0 || - pool_size[2] > 32 + pool_size[2] > me->_thr_limit /* pool_size[1] > 3 && pool_size[0] <= pool_size[1] */ ) { // queue not empty and not decrease - me->mgr.launch( connect_processor, me /* , 0, 0, PTHREAD_STACK_MIN * 2 */ ); + mgr.launch( connect_processor, me /* , 0, 0, PTHREAD_STACK_MIN * 2 */ ); } else { xmt::gettime( &now ); if ( (tpop + delta) < now ) { // a long time was since last pop from queue - me->mgr.launch( connect_processor, me /* , 0, 0, PTHREAD_STACK_MIN * 2 */ ); + mgr.launch( connect_processor, me /* , 0, 0, PTHREAD_STACK_MIN * 2 */ ); } } } + mgr.garbage_collector(); xmt::delay( &alarm ); } else { - if ( me->_observer_cnd.try_wait_delay( &idle ) != 0 ) { - MT_REENTRANT( me->_orlock, _1 ); - me->_observer_run = false; - + if ( /* me->_is_follow() && */ me->_observer_cnd.try_wait_delay( &idle ) != 0 && mgr.size() == 0 ) { return rtc; } } } while ( me->_is_follow() ); + + int count = 24; + while ( mgr.size() > 0 && count > 0 ) { + me->_pool_cnd.set( true, true ); + xmt::delay( &alarm ); + alarm *= 1.2; + --count; + } + if ( mgr.size() > 0 ) { + mgr.signal( SIGTERM ); + rtc.iword = -1; + } } catch ( ... ) { + rtc.iword = -1; } - MT_REENTRANT( me->_orlock, _1 ); - me->_observer_run = false; - return rtc; } Modified: trunk/complement/explore/include/sockios/sockmgr.h =================================================================== --- trunk/complement/explore/include/sockios/sockmgr.h 2007-02-01 17:23:03 UTC (rev 1502) +++ trunk/complement/explore/include/sockios/sockmgr.h 2007-02-01 17:24:46 UTC (rev 1503) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/01/31 23:52:05 ptr> +// -*- C++ -*- Time-stamp: <07/02/01 16:10:07 ptr> /* * Copyright (c) 1997-1999, 2002, 2003, 2005-2007 @@ -297,15 +297,11 @@ xmt::Condition _pool_cnd; xmt::Mutex _dlock; timespec _tpop; - xmt::ThreadMgr mgr; xmt::Mutex _flock; bool _follow; xmt::Condition _observer_cnd; - xmt::Mutex _orlock; - bool _observer_run; - timespec _busylimit; // start new thread to process incoming // requests, if processing thread busy // more then _busylimit Modified: trunk/complement/explore/lib/sockios/ChangeLog =================================================================== --- trunk/complement/explore/lib/sockios/ChangeLog 2007-02-01 17:23:03 UTC (rev 1502) +++ trunk/complement/explore/lib/sockios/ChangeLog 2007-02-01 17:24:46 UTC (rev 1503) @@ -6,6 +6,13 @@ * libsockios: Version 1.10.3 + * sockmgr.h, sockmgr.cc: start connect_processor threads + only from 'observer' thread; threads pool managed only + from 'observer' thread; 'observer' thread not in threads + pool, it start from 'loop'; + + * libsockios: Version 1.10.4 + 2007-01-31 Petr Ovtchenkov <pt...@is...> * sockmgr.h, sockmgr.cc: really erase iterators Modified: trunk/complement/explore/lib/sockios/Makefile.inc =================================================================== --- trunk/complement/explore/lib/sockios/Makefile.inc 2007-02-01 17:23:03 UTC (rev 1502) +++ trunk/complement/explore/lib/sockios/Makefile.inc 2007-02-01 17:24:46 UTC (rev 1503) @@ -1,9 +1,9 @@ -# -*- Makefile -*- Time-stamp: <07/01/31 10:07:17 ptr> +# -*- Makefile -*- Time-stamp: <07/02/01 19:53:51 ptr> LIBNAME = sockios MAJOR = 1 MINOR = 10 -PATCH = 2 +PATCH = 4 SRC_CC = _sockstream.cc _sockmgr.cc SRC_C = freebsd/getaddrinfo.c \ freebsd/ns_parse.c \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-02-01 17:23:08
|
Revision: 1502 http://svn.sourceforge.net/complement/?rev=1502&view=rev Author: complement Date: 2007-02-01 09:23:03 -0800 (Thu, 01 Feb 2007) Log Message: ----------- add 'signal' to thr_mgr---send signal to all good threads in pool; use fact, that thread's join in Thread destructor now. join in Thread destructor; timespec multiplication on double added Modified Paths: -------------- trunk/complement/explore/include/mt/thr_mgr.h trunk/complement/explore/include/mt/time.h trunk/complement/explore/lib/mt/ChangeLog trunk/complement/explore/lib/mt/thr_mgr.cc trunk/complement/explore/lib/mt/time.cc trunk/complement/explore/lib/mt/xmt.cc Modified: trunk/complement/explore/include/mt/thr_mgr.h =================================================================== --- trunk/complement/explore/include/mt/thr_mgr.h 2007-02-01 10:03:27 UTC (rev 1501) +++ trunk/complement/explore/include/mt/thr_mgr.h 2007-02-01 17:23:03 UTC (rev 1502) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/13 17:41:15 ptr> +// -*- C++ -*- Time-stamp: <07/02/01 18:39:25 ptr> /* * Copyright (c) 1997-1999, 2002, 2005, 2006 @@ -40,6 +40,7 @@ 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(); + __FIT_DECLSPEC void signal( int ); container_type::size_type size(); Modified: trunk/complement/explore/include/mt/time.h =================================================================== --- trunk/complement/explore/include/mt/time.h 2007-02-01 10:03:27 UTC (rev 1501) +++ trunk/complement/explore/include/mt/time.h 2007-02-01 17:23:03 UTC (rev 1502) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/15 10:21:37 ptr> +// -*- C++ -*- Time-stamp: <07/02/01 18:35:14 ptr> /* * Copyright (c) 2002, 2006 @@ -57,6 +57,7 @@ ::timespec operator /( const ::timespec& a, unsigned long b ); ::timespec operator *( const ::timespec& a, unsigned b ); ::timespec operator *( const ::timespec& a, unsigned long b ); +::timespec operator *( const ::timespec& a, double b ); inline ::timespec operator *( unsigned b, const ::timespec& a ) { return a * b; } inline ::timespec operator *( unsigned long b, const ::timespec& a ) @@ -69,6 +70,7 @@ ::timespec& operator /=( ::timespec& a, unsigned long b ); ::timespec& operator *=( ::timespec& a, unsigned b ); ::timespec& operator *=( ::timespec& a, unsigned long b ); +::timespec& operator *=( ::timespec& a, double b ); bool operator >( const ::timespec& a, const ::timespec& b ); bool operator >=( const ::timespec& a, const ::timespec& b ); Modified: trunk/complement/explore/lib/mt/ChangeLog =================================================================== --- trunk/complement/explore/lib/mt/ChangeLog 2007-02-01 10:03:27 UTC (rev 1501) +++ trunk/complement/explore/lib/mt/ChangeLog 2007-02-01 17:23:03 UTC (rev 1502) @@ -3,8 +3,14 @@ * thr_mgr.cc: reduce amount of code; try to 'join' to already closed threads, wait other in loop. [this is attempt to find workaround for deadlock within glibc, but speedup release - already free resources too] + already free resources too]; add 'signal'---send signal to all + good threads in pool; use fact, that thread's join in Thread + destructor now. + * xmt.cc: join in Thread destructor. + + * time.h, time.cc: timespec multiplication on double added. + * libxmt: version 1.9.5 2007-01-30 Petr Ovtchenkov <pt...@is...> Modified: trunk/complement/explore/lib/mt/thr_mgr.cc =================================================================== --- trunk/complement/explore/lib/mt/thr_mgr.cc 2007-02-01 10:03:27 UTC (rev 1501) +++ trunk/complement/explore/lib/mt/thr_mgr.cc 2007-02-01 17:23:03 UTC (rev 1502) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/02/01 11:18:04 ptr> +// -*- C++ -*- Time-stamp: <07/02/01 20:17:50 ptr> /* * Copyright (c) 1997-1999, 2002, 2005-2007 @@ -15,8 +15,12 @@ #include <algorithm> #include <functional> +// #include <iostream> + namespace xmt { +// int _supercount = 0; + using namespace std; struct bad_thread : @@ -26,6 +30,13 @@ { return !__x->good(); } }; +struct good_thread : + public unary_function<Thread *,bool> +{ + bool operator()(const Thread *__x) const + { return (__x != 0) && (__x->good()); } +}; + struct rm_if_bad_thread : public unary_function<Thread *,bool> { @@ -37,14 +48,27 @@ if ( __x == 0 ) { return true; } - if ( !__x->good() ) { - __x->join(); + if ( __x->bad() ) { + // --_supercount; delete __x; return true; } return false; } +struct thread_signal : + public binary_function<Thread *,int,void> +{ + void operator()(const Thread *__x, int sig ) const; +}; + +void thread_signal::operator()(const Thread *__x, int sig ) const +{ + if ( __x != 0 ) { + const_cast<Thread *>(__x)->kill( sig ); + } +} + __FIT_DECLSPEC ThreadMgr::~ThreadMgr() { ThreadMgr::join(); @@ -58,12 +82,17 @@ // xmt::block_signal( SIGCHLD ); // xmt::block_signal( SIGPOLL ); - Locker lk( _lock ); + _lock.lock(); _M_c.erase( remove_if( _M_c.begin(), _M_c.end(), rm_if_bad_thread() ), _M_c.end() ); while ( !_M_c.empty() ) { - xmt::delay( xmt::timespec(0,100000000) ); + _lock.unlock(); + xmt::delay( xmt::timespec(0,50000000) ); + _lock.lock(); _M_c.erase( remove_if( _M_c.begin(), _M_c.end(), rm_if_bad_thread() ), _M_c.end() ); + // cerr << "### " << _supercount << " " << _M_c.size() << endl; } + // _supercount = 0; + _lock.unlock(); } __FIT_DECLSPEC @@ -72,6 +101,7 @@ Locker lk( _lock ); _M_c.erase( remove_if( _M_c.begin(), _M_c.end(), rm_if_bad_thread() ), _M_c.end() ); _M_c.push_back( new Thread( entrance, p, psz, flags, stack_sz ) ); + // ++_supercount; } __FIT_DECLSPEC @@ -84,8 +114,17 @@ ThreadMgr::container_type::size_type ThreadMgr::size() { Locker lk( _lock ); - _M_c.erase( remove_if( _M_c.begin(), _M_c.end(), rm_if_bad_thread() ), _M_c.end() ); - return _M_c.size(); + // ThreadMgr::container_type::size_type sz = count_if( _M_c.begin(), _M_c.end(), good_thread() ); + // cerr << "Sz: " << sz << endl; + + return count_if( _M_c.begin(), _M_c.end(), good_thread() ); } +__FIT_DECLSPEC void ThreadMgr::signal( int sig ) +{ + // cerr << "Signal!" << endl; + Locker lk( _lock ); + for_each( _M_c.begin(), _M_c.end(), bind2nd( thread_signal(), sig ) ); +} + } // namespace xmt Modified: trunk/complement/explore/lib/mt/time.cc =================================================================== --- trunk/complement/explore/lib/mt/time.cc 2007-02-01 10:03:27 UTC (rev 1501) +++ trunk/complement/explore/lib/mt/time.cc 2007-02-01 17:23:03 UTC (rev 1502) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/15 10:35:48 ptr> +// -*- C++ -*- Time-stamp: <07/02/01 18:34:48 ptr> /* * Copyright (c) 2002, 2003, 2006 @@ -141,6 +141,16 @@ return c; } +timespec operator *( const timespec& a, double b ) +{ + timespec c; + double d = (a.tv_sec + 1.0e-9 * a.tv_nsec) * b; + + c.tv_nsec = static_cast<long>(1.0e9 * modf( d, &d ) + 0.5); + c.tv_sec = static_cast<time_t>(d); + return c; +} + timespec& operator +=( timespec& a, const timespec& b ) { a.tv_sec += b.tv_sec; @@ -210,6 +220,16 @@ return a; } +timespec& operator *=( timespec& a, double b ) +{ + double d = (a.tv_sec + 1.0e-9 * a.tv_nsec) * b; + + a.tv_nsec = static_cast<long>(1.0e9 * modf( d, &d ) + 0.5); + a.tv_sec = static_cast<time_t>(d); + + return a; +} + bool operator ==( const timespec& a, const timespec& b ) { return (a.tv_sec == b.tv_sec) && (a.tv_nsec == b.tv_nsec); Modified: trunk/complement/explore/lib/mt/xmt.cc =================================================================== --- trunk/complement/explore/lib/mt/xmt.cc 2007-02-01 10:03:27 UTC (rev 1501) +++ trunk/complement/explore/lib/mt/xmt.cc 2007-02-01 17:23:03 UTC (rev 1502) @@ -1,7 +1,7 @@ -// -*- C++ -*- Time-stamp: <07/01/29 18:53:22 ptr> +// -*- C++ -*- Time-stamp: <07/02/01 19:35:59 ptr> /* - * Copyright (c) 1997-1999, 2002-2006 + * Copyright (c) 1997-1999, 2002-2007 * Petr Ovtchenkov * * Portion Copyright (c) 1999-2001 @@ -363,6 +363,8 @@ __FIT_DECLSPEC Thread::Thread( Thread::entrance_type entrance, const void *p, size_t psz, unsigned __f, size_t stack_sz ) : + _id( bad_thread_id ), + _state( badbit ), _entrance( entrance ), _param( 0 ), _param_sz( 0 ), @@ -377,6 +379,7 @@ __FIT_DECLSPEC Thread::~Thread() { + Thread::join(); ((Init *)Init_buf)->~Init(); // _STLP_ASSERT( _id == bad_thread_id ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-02-01 10:03:29
|
Revision: 1501 http://svn.sourceforge.net/complement/?rev=1501&view=rev Author: complement Date: 2007-02-01 02:03:27 -0800 (Thu, 01 Feb 2007) Log Message: ----------- clean container with sockstreams, to force 'close' call for all connections during server close process; try to block some signals during close Modified Paths: -------------- trunk/complement/explore/include/config/_linux.h trunk/complement/explore/include/sockios/sockmgr.cc trunk/complement/explore/include/sockios/sockmgr.h trunk/complement/explore/lib/sockios/ChangeLog trunk/complement/explore/test/sockios/sockios_test.cc Modified: trunk/complement/explore/include/config/_linux.h =================================================================== --- trunk/complement/explore/include/config/_linux.h 2007-02-01 10:00:21 UTC (rev 1500) +++ trunk/complement/explore/include/config/_linux.h 2007-02-01 10:03:27 UTC (rev 1501) @@ -1,10 +1,12 @@ -/* Time-stamp: <05/12/12 10:47:37 ptr> */ +/* Time-stamp: <07/01/31 23:51:12 ptr> */ /* + * * Copyright (c) 2003-2007 * Petr Ovtchenkov * - * Licensed under the Academic Free License Version 3.0 + * Licensed under the Academic Free License version 3.0 + * */ #ifndef __config__linux_h @@ -17,7 +19,7 @@ /* * Include this first, due to <features.h> unconditionally redefine * a lot of macros. -*/ + */ #include <features.h> @@ -59,9 +61,10 @@ # error "__BYTE_ORDER neither __BIG_ENDIAN nor __LITTLE_ENDIAN; Fix me!" #endif -/* select-based socket manager not supported a long time, and produce errors on x64 - * I turn off usage of select -*/ +/* + * select-based socket manager not maintained a long time, and produce + * errors on x86_64, so I turn off usage of select + */ #define __FIT_NO_SELECT Modified: trunk/complement/explore/include/sockios/sockmgr.cc =================================================================== --- trunk/complement/explore/include/sockios/sockmgr.cc 2007-02-01 10:00:21 UTC (rev 1500) +++ trunk/complement/explore/include/sockios/sockmgr.cc 2007-02-01 10:03:27 UTC (rev 1501) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/01/31 09:43:59 ptr> +// -*- C++ -*- Time-stamp: <07/02/01 10:04:23 ptr> /* * Copyright (c) 1997-1999, 2002, 2003, 2005-2007 @@ -359,10 +359,17 @@ me->mgr.join(); + me->_M_c.clear(); // FIN still may not come yet; forse close + return rtc; // throw; } + xmt::block_signal( SIGINT ); + xmt::block_signal( SIGPIPE ); + xmt::block_signal( SIGCHLD ); + xmt::block_signal( SIGPOLL ); + me->_dlock.lock(); me->_follow = false; me->_pool_cnd.set( true, true ); @@ -377,6 +384,8 @@ me->mgr.join(); + me->_M_c.clear(); // FIN still may not come yet; forse close + return rtc; } @@ -456,6 +465,7 @@ } catch ( ... ) { } + return rtc; } Modified: trunk/complement/explore/include/sockios/sockmgr.h =================================================================== --- trunk/complement/explore/include/sockios/sockmgr.h 2007-02-01 10:00:21 UTC (rev 1500) +++ trunk/complement/explore/include/sockios/sockmgr.h 2007-02-01 10:03:27 UTC (rev 1501) @@ -1,7 +1,7 @@ -// -*- C++ -*- Time-stamp: <07/01/31 08:55:49 ptr> +// -*- C++ -*- Time-stamp: <07/01/31 23:52:05 ptr> /* - * Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 + * Copyright (c) 1997-1999, 2002, 2003, 2005-2007 * Petr Ovtchenkov * * Portion Copyright (c) 1999-2001 Modified: trunk/complement/explore/lib/sockios/ChangeLog =================================================================== --- trunk/complement/explore/lib/sockios/ChangeLog 2007-02-01 10:00:21 UTC (rev 1500) +++ trunk/complement/explore/lib/sockios/ChangeLog 2007-02-01 10:03:27 UTC (rev 1501) @@ -1,3 +1,11 @@ +2007-02-01 Petr Ovtchenkov <pt...@is...> + + * sockmgr.cc: clean container with sockstreams, + to force 'close' call for all connections during server + close process; try to block some signals during close. + + * libsockios: Version 1.10.3 + 2007-01-31 Petr Ovtchenkov <pt...@is...> * sockmgr.h, sockmgr.cc: really erase iterators @@ -2,3 +10,3 @@ from _conn_pool; remove sockstream from processing, - if it was closed during 'connect' processing. + if it was closed during 'connect' processing; Modified: trunk/complement/explore/test/sockios/sockios_test.cc =================================================================== --- trunk/complement/explore/test/sockios/sockios_test.cc 2007-02-01 10:00:21 UTC (rev 1500) +++ trunk/complement/explore/test/sockios/sockios_test.cc 2007-02-01 10:03:27 UTC (rev 1501) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/01/31 10:55:45 ptr> +// -*- C++ -*- Time-stamp: <07/01/31 23:47:57 ptr> /* * @@ -141,7 +141,7 @@ { public: Cnt( sockstream& ) - { xmt::Locker lk(lock); ++cnt; } + { xmt::Locker lk(lock); ++cnt; ++visits; } ~Cnt() { xmt::Locker lk(lock); --cnt; } @@ -152,19 +152,22 @@ void close() { } + static int get_visits() + { xmt::Locker lk(lock); return visits; } + static xmt::Mutex lock; static int cnt; + static int visits; }; xmt::Mutex Cnt::lock; int Cnt::cnt = 0; +int Cnt::visits = 0; void sockios_test::ctor_dtor() { - // Check, that naumber of ctors of Cnt is the same as number of called dtors - // i.e. all created Cnt freed. - // due to async nature of communication, no way to check Cnt::cnt - // before server stop. + // Check, that number of ctors of Cnt is the same as number of called dtors + // i.e. all created Cnt was released. { sockmgr_stream_MP<Cnt> srv( port ); @@ -178,6 +181,12 @@ BOOST_CHECK( s1.good() ); BOOST_CHECK( s1.is_open() ); + while ( Cnt::get_visits() == 0 ) { + xmt::delay( xmt::timespec(0,10000) ); + } + Cnt::lock.lock(); + BOOST_CHECK( Cnt::cnt == 1 ); + Cnt::lock.unlock(); } srv.close(); @@ -185,9 +194,14 @@ Cnt::lock.lock(); BOOST_CHECK( Cnt::cnt == 0 ); + Cnt::visits = 0; Cnt::lock.unlock(); - } + + Cnt::lock.lock(); + BOOST_CHECK( Cnt::cnt == 0 ); + Cnt::lock.unlock(); + { sockmgr_stream_MP<Cnt> srv( port ); @@ -207,6 +221,12 @@ BOOST_CHECK( s1.is_open() ); BOOST_CHECK( s2.good() ); BOOST_CHECK( s2.is_open() ); + while ( Cnt::get_visits() < 2 ) { + xmt::delay( xmt::timespec(0,10000) ); + } + Cnt::lock.lock(); + BOOST_CHECK( Cnt::cnt == 2 ); + Cnt::lock.unlock(); } srv.close(); @@ -215,8 +235,11 @@ Cnt::lock.lock(); BOOST_CHECK( Cnt::cnt == 0 ); Cnt::lock.unlock(); - } + + Cnt::lock.lock(); + BOOST_CHECK( Cnt::cnt == 0 ); + Cnt::lock.unlock(); } class loader This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-02-01 10:00:23
|
Revision: 1500 http://svn.sourceforge.net/complement/?rev=1500&view=rev Author: complement Date: 2007-02-01 02:00:21 -0800 (Thu, 01 Feb 2007) Log Message: ----------- reduce amount of code; try to 'join' to already closed threads, wait other in loop Modified Paths: -------------- trunk/complement/explore/lib/mt/ChangeLog trunk/complement/explore/lib/mt/Makefile.inc trunk/complement/explore/lib/mt/thr_mgr.cc trunk/complement/explore/test/mt/mt_test_suite.cc Modified: trunk/complement/explore/lib/mt/ChangeLog =================================================================== --- trunk/complement/explore/lib/mt/ChangeLog 2007-01-31 14:50:54 UTC (rev 1499) +++ trunk/complement/explore/lib/mt/ChangeLog 2007-02-01 10:00:21 UTC (rev 1500) @@ -1,3 +1,12 @@ +2007-02-01 Petr Ovtchenkov <pt...@is...> + + * thr_mgr.cc: reduce amount of code; try to 'join' to already + closed threads, wait other in loop. [this is attempt to find + workaround for deadlock within glibc, but speedup release + already free resources too] + + * libxmt: version 1.9.5 + 2007-01-30 Petr Ovtchenkov <pt...@is...> * shm.h: add named objects manager in shared segment Modified: trunk/complement/explore/lib/mt/Makefile.inc =================================================================== --- trunk/complement/explore/lib/mt/Makefile.inc 2007-01-31 14:50:54 UTC (rev 1499) +++ trunk/complement/explore/lib/mt/Makefile.inc 2007-02-01 10:00:21 UTC (rev 1500) @@ -1,8 +1,8 @@ -# -*- Makefile -*- Time-stamp: <06/11/29 01:59:50 ptr> +# -*- Makefile -*- Time-stamp: <07/02/01 11:14:39 ptr> LIBNAME = xmt MAJOR = 1 MINOR = 9 -PATCH = 4 +PATCH = 5 SRC_CC = xmt.cc thr_mgr.cc time.cc uid.cc shm.cc SRC_C = fl.c Modified: trunk/complement/explore/lib/mt/thr_mgr.cc =================================================================== --- trunk/complement/explore/lib/mt/thr_mgr.cc 2007-01-31 14:50:54 UTC (rev 1499) +++ trunk/complement/explore/lib/mt/thr_mgr.cc 2007-02-01 10:00:21 UTC (rev 1500) @@ -1,7 +1,7 @@ -// -*- C++ -*- Time-stamp: <06/12/13 17:54:09 ptr> +// -*- C++ -*- Time-stamp: <07/02/01 11:18:04 ptr> /* - * Copyright (c) 1997-1999, 2002, 2005, 2006 + * Copyright (c) 1997-1999, 2002, 2005-2007 * Petr Ovtchenkov * * Portion Copyright (c) 1999-2001 @@ -26,6 +26,25 @@ { return !__x->good(); } }; +struct rm_if_bad_thread : + public unary_function<Thread *,bool> +{ + bool operator()(Thread *__x); +}; + +bool rm_if_bad_thread::operator()(Thread *__x) +{ + if ( __x == 0 ) { + return true; + } + if ( !__x->good() ) { + __x->join(); + delete __x; + return true; + } + return false; +} + __FIT_DECLSPEC ThreadMgr::~ThreadMgr() { ThreadMgr::join(); @@ -33,70 +52,39 @@ __FIT_DECLSPEC void ThreadMgr::join() { - Locker lk( _lock ); - container_type::iterator i = _M_c.begin(); + // xmt::block_signal( SIGINT ); + // xmt::block_signal( SIGTERM ); + // xmt::block_signal( SIGPIPE ); + // xmt::block_signal( SIGCHLD ); + // xmt::block_signal( SIGPOLL ); - while ( i != _M_c.end() ) { - if ( (*i)->good() ) { - // (*i)->kill( SIGTERM ); - } - (*i)->join(); - delete *i; - _M_c.erase( i++ ); + Locker lk( _lock ); + _M_c.erase( remove_if( _M_c.begin(), _M_c.end(), rm_if_bad_thread() ), _M_c.end() ); + while ( !_M_c.empty() ) { + xmt::delay( xmt::timespec(0,100000000) ); + _M_c.erase( remove_if( _M_c.begin(), _M_c.end(), rm_if_bad_thread() ), _M_c.end() ); } } - __FIT_DECLSPEC void ThreadMgr::launch( Thread::entrance_type entrance, const void *p, size_t psz, unsigned flags, size_t stack_sz ) { - MT_REENTRANT( _lock, _x1 ); - container_type::iterator i = _M_c.begin(); - - while ( i != _M_c.end() ) { - if ( !(*i)->good() ) { - (*i)->join(); - delete *i; - _M_c.erase( i++ ); - } else { - ++i; - } - } - + Locker lk( _lock ); + _M_c.erase( remove_if( _M_c.begin(), _M_c.end(), rm_if_bad_thread() ), _M_c.end() ); _M_c.push_back( new Thread( entrance, p, psz, flags, stack_sz ) ); } __FIT_DECLSPEC void ThreadMgr::garbage_collector() { - MT_REENTRANT( _lock, _x1 ); - container_type::iterator i = _M_c.begin(); - - while ( i != _M_c.end() ) { - if ( !(*i)->good() ) { - (*i)->join(); - delete *i; - _M_c.erase( i++ ); - } else { - ++i; - } - } + Locker lk( _lock ); + _M_c.erase( remove_if( _M_c.begin(), _M_c.end(), rm_if_bad_thread() ), _M_c.end() ); } ThreadMgr::container_type::size_type ThreadMgr::size() { - MT_REENTRANT( _lock, _x1 ); - container_type::iterator i = _M_c.begin(); - - while ( i != _M_c.end() ) { - if ( !(*i)->good() ) { - (*i)->join(); - delete *i; - _M_c.erase( i++ ); - } else { - ++i; - } - } + Locker lk( _lock ); + _M_c.erase( remove_if( _M_c.begin(), _M_c.end(), rm_if_bad_thread() ), _M_c.end() ); return _M_c.size(); } Modified: trunk/complement/explore/test/mt/mt_test_suite.cc =================================================================== --- trunk/complement/explore/test/mt/mt_test_suite.cc 2007-01-31 14:50:54 UTC (rev 1499) +++ trunk/complement/explore/test/mt/mt_test_suite.cc 2007-02-01 10:00:21 UTC (rev 1500) @@ -1,7 +1,7 @@ -// -*- C++ -*- Time-stamp: <07/01/29 15:36:45 ptr> +// -*- C++ -*- Time-stamp: <07/01/31 23:51:46 ptr> /* - * Copyright (c) 2006 + * Copyright (c) 2006, 2007 * Petr Ovtchenkov * * Licensed under the Academic Free License Version 3.0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-31 14:51:04
|
Revision: 1499 http://svn.sourceforge.net/complement/?rev=1499&view=rev Author: complement Date: 2007-01-31 06:50:54 -0800 (Wed, 31 Jan 2007) Log Message: ----------- snapshot, 2007-01-31 Added Paths: ----------- tags/complement-20070131/ Copied: tags/complement-20070131 (from rev 1498, trunk/complement) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-31 14:50:31
|
Revision: 1498 http://svn.sourceforge.net/complement/?rev=1498&view=rev Author: complement Date: 2007-01-31 06:50:30 -0800 (Wed, 31 Jan 2007) Log Message: ----------- clean Removed Paths: ------------- tags/complement-20070131/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-31 14:49:59
|
Revision: 1497 http://svn.sourceforge.net/complement/?rev=1497&view=rev Author: complement Date: 2007-01-31 06:49:58 -0800 (Wed, 31 Jan 2007) Log Message: ----------- sockmgr with select not maintained a long time: turn it off on linux Modified Paths: -------------- trunk/complement/explore/include/config/_linux.h trunk/complement/explore/test/sockios/unit_test.cc Modified: trunk/complement/explore/include/config/_linux.h =================================================================== --- trunk/complement/explore/include/config/_linux.h 2007-01-31 13:28:07 UTC (rev 1496) +++ trunk/complement/explore/include/config/_linux.h 2007-01-31 14:49:58 UTC (rev 1497) @@ -1,21 +1,10 @@ /* Time-stamp: <05/12/12 10:47:37 ptr> */ /* - * - * Copyright (c) 2003-2005 + * Copyright (c) 2003-2007 * Petr Ovtchenkov * - * Licensed under the Academic Free License Version 2.1 - * - * 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. - * + * Licensed under the Academic Free License Version 3.0 */ #ifndef __config__linux_h @@ -70,4 +59,10 @@ # error "__BYTE_ORDER neither __BIG_ENDIAN nor __LITTLE_ENDIAN; Fix me!" #endif +/* select-based socket manager not supported a long time, and produce errors on x64 + * I turn off usage of select +*/ + +#define __FIT_NO_SELECT + #endif /* __config__linux_h */ Modified: trunk/complement/explore/test/sockios/unit_test.cc =================================================================== --- trunk/complement/explore/test/sockios/unit_test.cc 2007-01-31 13:28:07 UTC (rev 1496) +++ trunk/complement/explore/test/sockios/unit_test.cc 2007-01-31 14:49:58 UTC (rev 1497) @@ -252,9 +252,9 @@ #endif } +#ifndef __FIT_NO_SELECT void test_client_server_select_local_ack() { -#ifndef __FIT_NO_POLL try { // server listen localhost (127.0.0.1), but not listen ext interface: sockmgr_stream_MP_SELECT<ConnectionProcessor> srv( 0x7f000001, port ); // start server @@ -269,10 +269,8 @@ BOOST_ERROR( "host not found by name" ); pr_lock.unlock(); } -#else - BOOST_ERROR( "poll-based sockmgr not implemented on this platform" ); -#endif } +#endif void udp_test_client_server_poll() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-31 13:28:12
|
Revision: 1496 http://svn.sourceforge.net/complement/?rev=1496&view=rev Author: complement Date: 2007-01-31 05:28:07 -0800 (Wed, 31 Jan 2007) Log Message: ----------- clean Removed Paths: ------------- tags/complement-20070126/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-31 13:27:27
|
Revision: 1495 http://svn.sourceforge.net/complement/?rev=1495&view=rev Author: complement Date: 2007-01-31 05:27:26 -0800 (Wed, 31 Jan 2007) Log Message: ----------- snapshot, 2007-01-31 Added Paths: ----------- tags/complement-20070131/ Copied: tags/complement-20070131 (from rev 1494, trunk/complement) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-31 13:19:38
|
Revision: 1494 http://svn.sourceforge.net/complement/?rev=1494&view=rev Author: complement Date: 2007-01-31 05:19:34 -0800 (Wed, 31 Jan 2007) Log Message: ----------- exclude misc lib Modified Paths: -------------- trunk/complement/explore/lib/Makefile Modified: trunk/complement/explore/lib/Makefile =================================================================== --- trunk/complement/explore/lib/Makefile 2007-01-31 13:08:32 UTC (rev 1493) +++ trunk/complement/explore/lib/Makefile 2007-01-31 13:19:34 UTC (rev 1494) @@ -1,13 +1,13 @@ # Time-stamp: <07/01/23 14:12:04 ptr> # -# Copyright (c) 2006 +# Copyright (c) 2006, 2007 # Petr Ovtchenkov # # Licensed under the Academic Free License version 3.0 # SRCROOT := .. -SUBDIRS := mt sockios stem misc +SUBDIRS := mt sockios stem include ${SRCROOT}/Makefiles/gmake/subdirs.mak This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-31 13:08:34
|
Revision: 1493 http://svn.sourceforge.net/complement/?rev=1493&view=rev Author: complement Date: 2007-01-31 05:08:32 -0800 (Wed, 31 Jan 2007) Log Message: ----------- use parameter, not predefined var Modified Paths: -------------- trunk/complement/explore/lib/Makefile Modified: trunk/complement/explore/lib/Makefile =================================================================== --- trunk/complement/explore/lib/Makefile 2007-01-31 13:07:59 UTC (rev 1492) +++ trunk/complement/explore/lib/Makefile 2007-01-31 13:08:32 UTC (rev 1493) @@ -12,6 +12,6 @@ include ${SRCROOT}/Makefiles/gmake/subdirs.mak all install depend clean clobber distclean check: - $(doinsubdirs) + $(call doinsubdirs,${SUBDIRS}) .PHONY: all install depend clean clobber distclean check This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-31 13:08:02
|
Revision: 1492 http://svn.sourceforge.net/complement/?rev=1492&view=rev Author: complement Date: 2007-01-31 05:07:59 -0800 (Wed, 31 Jan 2007) Log Message: ----------- use parameter, not predefined var Modified Paths: -------------- trunk/complement/explore/Makefiles/gmake/subdirs.mak Modified: trunk/complement/explore/Makefiles/gmake/subdirs.mak =================================================================== --- trunk/complement/explore/Makefiles/gmake/subdirs.mak 2007-01-31 13:06:27 UTC (rev 1491) +++ trunk/complement/explore/Makefiles/gmake/subdirs.mak 2007-01-31 13:07:59 UTC (rev 1492) @@ -6,18 +6,9 @@ # Licensed under the Academic Free License version 3.0 # -ifdef SUBDIRS -# Do the same target in all catalogs from SUBDIRS +# Do the same target in all catalogs as arg define doinsubdirs -@for d in ${SUBDIRS}; do \ - ${MAKE} -C $$d $@; \ +@for d in $(1); do \ + ${MAKE} -C $$d $@ || exit 1; \ done endef - -else -# Dummy, do nothing -define doinsubdirs -endef - -endif - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-31 13:06:28
|
Revision: 1491 http://svn.sourceforge.net/complement/?rev=1491&view=rev Author: complement Date: 2007-01-31 05:06:27 -0800 (Wed, 31 Jan 2007) Log Message: ----------- not required to link with libs Modified Paths: -------------- trunk/complement/explore/test/stem/dl/Makefile Modified: trunk/complement/explore/test/stem/dl/Makefile =================================================================== --- trunk/complement/explore/test/stem/dl/Makefile 2007-01-31 11:45:23 UTC (rev 1490) +++ trunk/complement/explore/test/stem/dl/Makefile 2007-01-31 13:06:27 UTC (rev 1491) @@ -9,10 +9,10 @@ INCLUDES += -I$(SRCROOT)/include -I$(BOOST_INCLUDE_DIR) -LDSEARCH = -L${STLPORT_LIB_DIR} -L${CoMT_LIB_DIR} +#LDSEARCH = -L${STLPORT_LIB_DIR} -L${CoMT_LIB_DIR} -release-shared : LDLIBS = -lxmt -lsockios -lstem -lboost_test_utf -stldbg-shared : LDLIBS = -lxmtstlg -lsockiosstlg -lstemstlg -lboost_test_utfstlg -dbg-shared : LDLIBS = -lxmtg -lsockiosg -lstemg -lboost_test_utfg +#release-shared : LDLIBS = -lxmt -lsockios -lstem -lboost_test_utf +#stldbg-shared : LDLIBS = -lxmtstlg -lsockiosstlg -lstemstlg -lboost_test_utfstlg +#dbg-shared : LDLIBS = -lxmtg -lsockiosg -lstemg -lboost_test_utfg -LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR}:${CoMT_LIB_DIR} +#LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR}:${CoMT_LIB_DIR} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-31 11:45:25
|
Revision: 1490 http://svn.sourceforge.net/complement/?rev=1490&view=rev Author: complement Date: 2007-01-31 03:45:23 -0800 (Wed, 31 Jan 2007) Log Message: ----------- PRGNAME may be omitted, if PRGNAMES present Modified Paths: -------------- trunk/complement/explore/Makefiles/gmake/app/macro.mak trunk/complement/explore/Makefiles/top.mak Added Paths: ----------- trunk/complement/explore/Makefiles/ut/app2-mult/ trunk/complement/explore/Makefiles/ut/app2-mult/Makefile trunk/complement/explore/Makefiles/ut/app2-mult/Makefile.inc trunk/complement/explore/Makefiles/ut/app2-mult/test2.cc trunk/complement/explore/Makefiles/ut/app2-mult/test3.cc trunk/complement/explore/Makefiles/ut/app2-mult/test31.cc Modified: trunk/complement/explore/Makefiles/gmake/app/macro.mak =================================================================== --- trunk/complement/explore/Makefiles/gmake/app/macro.mak 2007-01-31 08:03:15 UTC (rev 1489) +++ trunk/complement/explore/Makefiles/gmake/app/macro.mak 2007-01-31 11:45:23 UTC (rev 1490) @@ -1,6 +1,6 @@ # Time-stamp: <06/11/16 23:37:38 ptr> # -# Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 +# Copyright (c) 1997-1999, 2002, 2003, 2005-2007 # Petr Ovtchenkov # # Portion Copyright (c) 1999-2001 @@ -9,10 +9,16 @@ # Licensed under the Academic Free License version 3.0 # -ALLPRGS = -ALLPRGS_DBG = -ALLPRGS_STLDBG = +ifdef PRGNAME +PRG := $(OUTPUT_DIR)/${PRGNAME}${EXE} +PRG_DBG := $(OUTPUT_DIR_DBG)/${PRGNAME}${EXE} +PRG_STLDBG := $(OUTPUT_DIR_STLDBG)/${PRGNAME}${EXE} +endif +ALLPRGS = ${PRG} +ALLPRGS_DBG = ${PRG_DBG} +ALLPRGS_STLDBG = ${PRG_STLDBG} + define prog_prog $(1)_PRG := $(OUTPUT_DIR)/$(1)${EXE} $(1)_PRG_DBG := $(OUTPUT_DIR_DBG)/$(1)${EXE} @@ -25,8 +31,4 @@ $(foreach prg,$(PRGNAMES),$(eval $(call prog_prog,$(prg)))) -PRG := $(OUTPUT_DIR)/${PRGNAME}${EXE} -PRG_DBG := $(OUTPUT_DIR_DBG)/${PRGNAME}${EXE} -PRG_STLDBG := $(OUTPUT_DIR_STLDBG)/${PRGNAME}${EXE} - LDFLAGS += ${LDSEARCH} Modified: trunk/complement/explore/Makefiles/top.mak =================================================================== --- trunk/complement/explore/Makefiles/top.mak 2007-01-31 08:03:15 UTC (rev 1489) +++ trunk/complement/explore/Makefiles/top.mak 2007-01-31 11:45:23 UTC (rev 1490) @@ -109,10 +109,10 @@ # if target is program, rules for executable ifdef PRGNAME include ${RULESBASE}/$(USE_MAKE)/app/top.mak -endif - +else ifdef PRGNAMES -# include ${RULESBASE}/$(USE_MAKE)/app/top.mak +include ${RULESBASE}/$(USE_MAKE)/app/top.mak endif +endif .PHONY: $(PHONY) Property changes on: trunk/complement/explore/Makefiles/ut/app2-mult ___________________________________________________________________ Name: svn:ignore + obj Added: trunk/complement/explore/Makefiles/ut/app2-mult/Makefile =================================================================== --- trunk/complement/explore/Makefiles/ut/app2-mult/Makefile (rev 0) +++ trunk/complement/explore/Makefiles/ut/app2-mult/Makefile 2007-01-31 11:45:23 UTC (rev 1490) @@ -0,0 +1,38 @@ +# -*- Makefile -*- Time-stamp: <06/11/13 23:03:45 ptr> + +SRCROOT := ../../.. + +# EXTRA_POST := check-release-shared +# EXTRA_POST_DBG := check-dbg-shared +# EXTRA_POST_STLDBG := check-stldbg-shared + +include Makefile.inc +include ${SRCROOT}/Makefiles/top.mak + +ifndef WITHOUT_STLPORT +LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} +endif + +check: check-release-shared check-dbg-shared check-stldbg-shared + +check-release-shared: release-shared + @echo Running 2 test cases... + @file ${test2_PRG} | grep ELF >/dev/null || exit 1 + @file ${test3_PRG} | grep ELF >/dev/null || exit 1 + @echo "*** No errors detected" + +check-dbg-shared: dbg-shared + @echo Running 2 test cases... + @file ${test2_PRG_DBG} | grep ELF >/dev/null || exit 1 + @file ${test3_PRG_DBG} | grep ELF >/dev/null || exit 1 + @echo "*** No errors detected" + +ifndef WITHOUT_STLPORT +check-stldbg-shared: stldbg-shared + @echo Running 2 test cases... + @file ${test2_PRG_STLDBG} | grep ELF >/dev/null || exit 1 + @file ${test3_PRG_STLDBG} | grep ELF >/dev/null || exit 1 + @echo "*** No errors detected" +endif + +PHONY += check check-release-shared check-dbg-shared check-stldbg-shared Added: trunk/complement/explore/Makefiles/ut/app2-mult/Makefile.inc =================================================================== --- trunk/complement/explore/Makefiles/ut/app2-mult/Makefile.inc (rev 0) +++ trunk/complement/explore/Makefiles/ut/app2-mult/Makefile.inc 2007-01-31 11:45:23 UTC (rev 1490) @@ -0,0 +1,7 @@ +# -*- makefile -*- Time-stamp: <04/01/12 15:37:40 ptr> + +PRGNAMES = test2 test3 +#SRC_C = test.c +SRC_CC = test.cc +test2_SRC_CC = test2.cc +test3_SRC_CC = test3.cc test31.cc Added: trunk/complement/explore/Makefiles/ut/app2-mult/test2.cc =================================================================== --- trunk/complement/explore/Makefiles/ut/app2-mult/test2.cc (rev 0) +++ trunk/complement/explore/Makefiles/ut/app2-mult/test2.cc 2007-01-31 11:45:23 UTC (rev 1490) @@ -0,0 +1,4 @@ +int main() +{ + return 2; +} Added: trunk/complement/explore/Makefiles/ut/app2-mult/test3.cc =================================================================== --- trunk/complement/explore/Makefiles/ut/app2-mult/test3.cc (rev 0) +++ trunk/complement/explore/Makefiles/ut/app2-mult/test3.cc 2007-01-31 11:45:23 UTC (rev 1490) @@ -0,0 +1,4 @@ +int main() +{ + return 3; +} Added: trunk/complement/explore/Makefiles/ut/app2-mult/test31.cc =================================================================== --- trunk/complement/explore/Makefiles/ut/app2-mult/test31.cc (rev 0) +++ trunk/complement/explore/Makefiles/ut/app2-mult/test31.cc 2007-01-31 11:45:23 UTC (rev 1490) @@ -0,0 +1,4 @@ +int f() +{ + return 3; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-31 08:03:17
|
Revision: 1489 http://svn.sourceforge.net/complement/?rev=1489&view=rev Author: complement Date: 2007-01-31 00:03:15 -0800 (Wed, 31 Jan 2007) Log Message: ----------- really erase iterators from _conn_pool; remove sockstream from processing, if it was closed during 'connect' processing. Modified Paths: -------------- trunk/complement/explore/include/sockios/sockmgr.cc trunk/complement/explore/include/sockios/sockmgr.h trunk/complement/explore/lib/sockios/ChangeLog trunk/complement/explore/lib/sockios/Makefile.inc trunk/complement/explore/test/sockios/sockios_test.cc Modified: trunk/complement/explore/include/sockios/sockmgr.cc =================================================================== --- trunk/complement/explore/include/sockios/sockmgr.cc 2007-01-30 15:14:56 UTC (rev 1488) +++ trunk/complement/explore/include/sockios/sockmgr.cc 2007-01-31 08:03:15 UTC (rev 1489) @@ -1,7 +1,7 @@ -// -*- C++ -*- Time-stamp: <06/12/15 01:27:36 ptr> +// -*- C++ -*- Time-stamp: <07/01/31 09:43:59 ptr> /* - * Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 + * Copyright (c) 1997-1999, 2002, 2003, 2005-2007 * Petr Ovtchenkov * * Portion Copyright (c) 1999-2001 @@ -100,6 +100,7 @@ // cerr << __FILE__ << ":" << __LINE__ << endl; // } if ( j->revents != 0 ) { + xmt::Locker _l( _c_lock ); // We should distinguish closed socket from income message typename container_type::iterator i = find_if( _M_c.begin(), _M_c.end(), bind2nd( _M_comp, j->fd ) ); @@ -114,7 +115,7 @@ 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 ); + _conn_pool.erase( std::remove( _conn_pool.begin(), _conn_pool.end(), i ), _conn_pool.end() ); _dlock.unlock(); _M_c.erase( i++ ); } @@ -124,7 +125,7 @@ _pfd.erase( j ); j = _pfd.begin() + (d - 1); _dlock.lock(); - std::remove( _conn_pool.begin(), _conn_pool.end(), i ); + _conn_pool.erase( std::remove( _conn_pool.begin(), _conn_pool.end(), i ), _conn_pool.end() ); _dlock.unlock(); _M_c.erase( i ); } else { @@ -141,7 +142,7 @@ _pfd.erase( j ); j = _pfd.begin() + (d - 1); _dlock.lock(); - std::remove( _conn_pool.begin(), _conn_pool.end(), i ); + _conn_pool.erase( std::remove( _conn_pool.begin(), _conn_pool.end(), i ), _conn_pool.end() ); _dlock.unlock(); _M_c.erase( i ); } else { // normal data available for reading @@ -216,10 +217,10 @@ } try { - _Connect *cl_new; + xmt::Locker _l( _c_lock ); _M_c.push_back( _Connect() ); _M_c.back().open( _sd, addr.any ); - cl_new = &_M_c.back(); + _Connect *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 @@ -418,6 +419,13 @@ sock_base::socket_type rfd = stream.rdbuf()->fd(); ::write( me->_cfd, reinterpret_cast<const char *>(&rfd), sizeof(sock_base::socket_type) ); } + } else { + me->_dlock.lock(); + me->_conn_pool.erase( std::remove( me->_conn_pool.begin(), me->_conn_pool.end(), c ), me->_conn_pool.end() ); + me->_dlock.unlock(); + + xmt::Locker _l( me->_c_lock ); + me->_M_c.erase( c ); } } } Modified: trunk/complement/explore/include/sockios/sockmgr.h =================================================================== --- trunk/complement/explore/include/sockios/sockmgr.h 2007-01-30 15:14:56 UTC (rev 1488) +++ trunk/complement/explore/include/sockios/sockmgr.h 2007-01-31 08:03:15 UTC (rev 1489) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/13 17:38:44 ptr> +// -*- C++ -*- Time-stamp: <07/01/31 08:55:49 ptr> /* * Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 @@ -289,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 2007-01-30 15:14:56 UTC (rev 1488) +++ trunk/complement/explore/lib/sockios/ChangeLog 2007-01-31 08:03:15 UTC (rev 1489) @@ -1,3 +1,11 @@ +2007-01-31 Petr Ovtchenkov <pt...@is...> + + * sockmgr.h, sockmgr.cc: really erase iterators + from _conn_pool; remove sockstream from processing, + if it was closed during 'connect' processing. + + * libsockios: Version 1.10.2 + 2006-12-13 Petr Ovtchenkov <pt...@is...> * sockmgr.h, sockmgr.cc: container now single owner Modified: trunk/complement/explore/lib/sockios/Makefile.inc =================================================================== --- trunk/complement/explore/lib/sockios/Makefile.inc 2007-01-30 15:14:56 UTC (rev 1488) +++ trunk/complement/explore/lib/sockios/Makefile.inc 2007-01-31 08:03:15 UTC (rev 1489) @@ -1,9 +1,9 @@ -# -*- Makefile -*- Time-stamp: <06/11/29 18:47:25 ptr> +# -*- Makefile -*- Time-stamp: <07/01/31 10:07:17 ptr> LIBNAME = sockios MAJOR = 1 MINOR = 10 -PATCH = 1 +PATCH = 2 SRC_CC = _sockstream.cc _sockmgr.cc SRC_C = freebsd/getaddrinfo.c \ freebsd/ns_parse.c \ Modified: trunk/complement/explore/test/sockios/sockios_test.cc =================================================================== --- trunk/complement/explore/test/sockios/sockios_test.cc 2007-01-30 15:14:56 UTC (rev 1488) +++ trunk/complement/explore/test/sockios/sockios_test.cc 2007-01-31 08:03:15 UTC (rev 1489) @@ -1,8 +1,8 @@ -// -*- C++ -*- Time-stamp: <07/01/30 11:45:52 ptr> +// -*- C++ -*- Time-stamp: <07/01/31 10:55:45 ptr> /* * - * Copyright (c) 2002, 2003, 2005, 2006 + * Copyright (c) 2002, 2003, 2005-2007 * Petr Ovtchenkov * * Licensed under the Academic Free License version 3.0 @@ -375,23 +375,23 @@ long_msg_processor::long_msg_processor( std::sockstream& ) { - cerr << "long_msg_processor::long_msg_processor" << endl; + // cerr << "long_msg_processor::long_msg_processor" << endl; } void long_msg_processor::connect( std::sockstream& s ) { - cerr << "long_msg_processor::connect" << endl; + // cerr << "long_msg_processor::connect" << endl; string l; getline( s, l ); - cerr << "Is good? " << s.good() << endl; + // cerr << "Is good? " << s.good() << endl; } void long_msg_processor::close() { - cerr << "long_msg_processor::close()" << endl; + // cerr << "long_msg_processor::close()" << endl; cnd->set( true ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-30 15:15:09
|
Revision: 1488 http://svn.sourceforge.net/complement/?rev=1488&view=rev Author: complement Date: 2007-01-30 07:14:56 -0800 (Tue, 30 Jan 2007) Log Message: ----------- inquiry boost::program_options Added Paths: ----------- trunk/complement/explore/inquiry/boost/program_options/ trunk/complement/explore/inquiry/boost/program_options/Makefile trunk/complement/explore/inquiry/boost/program_options/Makefile.inc trunk/complement/explore/inquiry/boost/program_options/po.cc Property changes on: trunk/complement/explore/inquiry/boost/program_options ___________________________________________________________________ Name: svn:ignore + obj Added: trunk/complement/explore/inquiry/boost/program_options/Makefile =================================================================== --- trunk/complement/explore/inquiry/boost/program_options/Makefile (rev 0) +++ trunk/complement/explore/inquiry/boost/program_options/Makefile 2007-01-30 15:14:56 UTC (rev 1488) @@ -0,0 +1,19 @@ +# -*- Makefile -*- Time-stamp: <03/11/21 08:02:55 ptr> + +SRCROOT := ../../.. +COMPILER_NAME := gcc + +include Makefile.inc +include ${SRCROOT}/Makefiles/top.mak + + +INCLUDES += -I$(SRCROOT)/include -I$(BOOST_INCLUDE_DIR) + +# temporary, before dums fix strings: +# DEFS += -D_STLP_DONT_USE_TEMPLATE_EXPRESSION + +LDFLAGS += -L${CoMT_LIB_DIR} -Wl,--rpath=${CoMT_LIB_DIR}:${STLPORT_LIB_DIR} + +release-shared : LDLIBS = -lboost_program_options +stldbg-shared : LDLIBS = -lboost_program_optionsstlg +dbg-shared : LDLIBS = -lboost_program_optionsg Added: trunk/complement/explore/inquiry/boost/program_options/Makefile.inc =================================================================== --- trunk/complement/explore/inquiry/boost/program_options/Makefile.inc (rev 0) +++ trunk/complement/explore/inquiry/boost/program_options/Makefile.inc 2007-01-30 15:14:56 UTC (rev 1488) @@ -0,0 +1,4 @@ +# -*- makefile -*- Time-stamp: <04/05/06 18:40:56 ptr> + +PRGNAME = po +SRC_CC = po.cc Added: trunk/complement/explore/inquiry/boost/program_options/po.cc =================================================================== --- trunk/complement/explore/inquiry/boost/program_options/po.cc (rev 0) +++ trunk/complement/explore/inquiry/boost/program_options/po.cc 2007-01-30 15:14:56 UTC (rev 1488) @@ -0,0 +1,55 @@ +// -*- C++ -*- Time-stamp: <07/01/25 20:52:45 ptr> + +#include <iostream> +#include <boost/program_options.hpp> + +using namespace std; +namespace po = boost::program_options; + +int main( int argc, const char **argv ) +{ + int port; + bool is_daemon = false; + std::string catalog; + try { + po::options_description op( "Copyright (C) RightMedia, 2006-2007\nThis is intercessor to reportware (http request retranslator, storing answers)\nOptions" ); + op.add_options() + ( "help,h", "print this help message" ) + ( "port,p", po::value<int>(&port)->default_value(8080), "listen port (default 8080)" ) + ( "save,s", po::value<string>(&catalog), "store uploaded stream to catalog (default none)" ) + ( "daemon,d", "become daemon" ); + + po::variables_map vm; + po::store( po::parse_command_line( argc, const_cast<char **>(argv), op ), vm ); + po::notify( vm ); + + if ( vm.count( "help" ) ) { + cerr << op << endl; + return 0; + } + + // if ( vm.count( "port" ) ) { + // port = vm["port"].as<int>(); + // } + + // if ( vm.count( "save" ) ) { + // catalog = vm["save"].as<string>(); + // } + + if ( vm.count( "daemon" ) ) { + is_daemon = true; + } + + cout << "Port: " << port << "\n" + << "Catalog: " << catalog << "\n" + << "Daemon: " << is_daemon << endl; + } + catch ( int i ) { + cerr << "exception i " << i << endl; + } + catch ( exception& err ) { + cerr << "exception " << err.what() << endl; + } + + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-30 15:14:25
|
Revision: 1487 http://svn.sourceforge.net/complement/?rev=1487&view=rev Author: complement Date: 2007-01-30 07:14:17 -0800 (Tue, 30 Jan 2007) Log Message: ----------- problems, when we overload address operator (&) Added Paths: ----------- trunk/complement/explore/inquiry/STLport/address/ trunk/complement/explore/inquiry/STLport/address/Makefile trunk/complement/explore/inquiry/STLport/address/Makefile.inc trunk/complement/explore/inquiry/STLport/address/test.cc Property changes on: trunk/complement/explore/inquiry/STLport/address ___________________________________________________________________ Name: svn:ignore + obj Added: trunk/complement/explore/inquiry/STLport/address/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/address/Makefile (rev 0) +++ trunk/complement/explore/inquiry/STLport/address/Makefile 2007-01-30 15:14:17 UTC (rev 1487) @@ -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/address/Makefile.inc =================================================================== --- trunk/complement/explore/inquiry/STLport/address/Makefile.inc (rev 0) +++ trunk/complement/explore/inquiry/STLport/address/Makefile.inc 2007-01-30 15:14:17 UTC (rev 1487) @@ -0,0 +1,4 @@ +# -*- makefile -*- Time-stamp: <02/07/14 14:03:13 ptr> + +PRGNAME = test +SRC_CC = test.cc Added: trunk/complement/explore/inquiry/STLport/address/test.cc =================================================================== --- trunk/complement/explore/inquiry/STLport/address/test.cc (rev 0) +++ trunk/complement/explore/inquiry/STLport/address/test.cc 2007-01-30 15:14:17 UTC (rev 1487) @@ -0,0 +1,31 @@ +/* +Overload of address operator (&), that return double, not v *; no way to take +address of object of type v; may be constructor v(double) and convert to double can help... +*/ +#include <vector> + +using namespace std; + +class v +{ + private: + double p[3]; + + public: + v() {} + v( double ) {} + + double *operator &() { return p; } + const double *operator &() const { return p; } + double() const { return p[0]; } +}; + +int main() +{ + vector<v> vec; + + vec.push_back( v() ); + + return 0; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-30 15:09:58
|
Revision: 1486 http://svn.sourceforge.net/complement/?rev=1486&view=rev Author: complement Date: 2007-01-30 07:09:56 -0800 (Tue, 30 Jan 2007) Log Message: ----------- use shared memory segment for sync (named objects, if required); remove delays and reduce amount of threads for some tests, to reduce test suite time; test for problem: two 'connect', but no 'close' on closed sockstream Modified Paths: -------------- trunk/complement/explore/test/sockios/client-wc.cc trunk/complement/explore/test/sockios/read0_on_exec.cc trunk/complement/explore/test/sockios/sockios_test.cc trunk/complement/explore/test/sockios/sockios_test.h trunk/complement/explore/test/sockios/sockios_test_suite.cc trunk/complement/explore/test/sockios/unit_test.cc Modified: trunk/complement/explore/test/sockios/client-wc.cc =================================================================== --- trunk/complement/explore/test/sockios/client-wc.cc 2007-01-30 15:06:35 UTC (rev 1485) +++ trunk/complement/explore/test/sockios/client-wc.cc 2007-01-30 15:09:56 UTC (rev 1486) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/15 10:49:16 ptr> +// -*- C++ -*- Time-stamp: <07/01/29 17:48:29 ptr> /* * Copyright (c) 2004, 2006 @@ -28,6 +28,7 @@ Suspicious processing with FreeBSD and OpenBSD servers. */ +static Condition cnd_close; class Srv // { @@ -42,10 +43,11 @@ { s << "hello" << endl; - xmt::delay( xmt::timespec( 1, 0 ) ); + // xmt::delay( xmt::timespec( 1, 0 ) ); s.close(); // ::shutdown( s.rdbuf()->fd(), 2 ); + cnd_close.set( true ); } void Srv::connect( std::sockstream& ) @@ -104,7 +106,7 @@ BOOST_CHECK( buf == "hello" ); pr_lock.unlock(); - xmt::delay( xmt::timespec( 5, 0 ) ); + // xmt::delay( xmt::timespec( 5, 0 ) ); // sock << 'a' << endl; @@ -113,6 +115,8 @@ and no other solution! (another solution is nonblock sockets or aio, but this is another story) */ + cnd_close.try_wait(); + char a; sock.read( &a, 1 ); @@ -132,6 +136,7 @@ void srv_close_connection_test() { Thread srv( server_proc ); + cnd_close.set( false ); Thread client( client_proc ); client.join(); Modified: trunk/complement/explore/test/sockios/read0_on_exec.cc =================================================================== --- trunk/complement/explore/test/sockios/read0_on_exec.cc 2007-01-30 15:06:35 UTC (rev 1485) +++ trunk/complement/explore/test/sockios/read0_on_exec.cc 2007-01-30 15:09:56 UTC (rev 1486) @@ -1,7 +1,7 @@ -// -*- C++ -*- Time-stamp: <06/12/15 10:50:48 ptr> +// -*- C++ -*- Time-stamp: <07/01/29 19:17:54 ptr> /* - * Copyright (c) 2006 + * Copyright (c) 2006, 2007 * Petr Ovtchenkov * * Licensed under the Academic Free License Version 3.0 @@ -21,7 +21,7 @@ #include <sys/types.h> #include <sys/wait.h> -#include <sys/shm.h> +#include <mt/shm.h> using namespace std; using namespace xmt; @@ -122,63 +122,61 @@ void test_read0() { - shmid_ds ds; - int id = shmget( 5000, 1024, IPC_CREAT | IPC_EXCL | 0600 ); - if ( id == -1 ) { - cerr << "Error on shmget" << endl; - } - if ( shmctl( id, IPC_STAT, &ds ) == -1 ) { - cerr << "Error on shmctl" << endl; - } - void *buf = shmat( id, 0, 0 ); - if ( buf == reinterpret_cast<void *>(-1) ) { - cerr << "Error on shmat" << endl; - } + const char fname[] = "/tmp/sockios_test.shm"; + try { + xmt::shm_alloc<0> seg; - Semaphore& sem = *new( buf ) Semaphore( 1, true ); + seg.allocate( fname, 4*4096, xmt::shm_base::create | xmt::shm_base::exclusive, 0600 ); + // xmt::shm_name_mgr<0>& nm = seg.name_mgr(); - try { - // cerr << "** 1" << endl; - // cndf.set( false ); + xmt::allocator_shm<xmt::__Condition<true>,0> shm; - xmt::fork(); // <---- key line - sem.wait(); // wait server for listen us - // cerr << "** 2" << endl; + xmt::__Condition<true>& fcnd = *new ( shm.allocate( 1 ) ) xmt::__Condition<true>(); + // nm.named( fcnd, 1 ); + fcnd.set( false ); - Condition cnd; - cnd.set( false ); + try { + xmt::fork(); // <---- key line + fcnd.try_wait(); // wait server for listen us - xmt::Thread thr( thread_entry, &cnd ); + Condition cnd; + cnd.set( false ); - cnd.try_wait(); // wait for read call + xmt::Thread thr( thread_entry, &cnd ); - delay( xmt::timespec(1,0) ); + cnd.try_wait(); // wait for read call - // cerr << "system" << endl; - system( "echo > /dev/null" ); // <------ key line - // cerr << "after system" << endl; + delay( xmt::timespec(1,0) ); - thr.join(); - // cerr << "exit child" << endl; - exit( 0 ); - } - catch ( xmt::fork_in_parent& child ) { - // cerr << "** 3" << endl; - sockmgr_stream_MP<ConnectionProcessor5> srv( ::port ); // start server + // cerr << "system" << endl; + system( "echo > /dev/null" ); // <------ key line + // cerr << "after system" << endl; - // cndf.set( true ); // server wait, I hope - sem.post(); - int stat; - // cerr << "wait " << child.pid() << endl; - waitpid( child.pid(), &stat, 0 ); - // cerr << "close all" << endl; - srv.close(); - srv.wait(); - } - (&sem)->~Semaphore(); + thr.join(); + // cerr << "exit child" << endl; + exit( 0 ); + } + catch ( xmt::fork_in_parent& child ) { + // cerr << "** 3" << endl; + sockmgr_stream_MP<ConnectionProcessor5> srv( ::port ); // start server - shmdt( buf ); - shmctl( id, IPC_RMID, &ds ); + fcnd.set( true ); + + int stat; + waitpid( child.pid(), &stat, 0 ); + srv.close(); + srv.wait(); + } + + (&fcnd)->~__Condition<true>(); + shm.deallocate( &fcnd, 1 ); + + seg.deallocate(); + unlink( fname ); + } + catch ( xmt::shm_bad_alloc& err ) { + BOOST_CHECK_MESSAGE( false, "error report: " << err.what() ); + } } class ConnectionProcessor6 // dummy variant @@ -190,7 +188,7 @@ void close(); }; -static Semaphore *sem2; +static __Semaphore<true> *sem2; ConnectionProcessor6::ConnectionProcessor6( std::sockstream& s ) { @@ -216,55 +214,53 @@ void test_read0_srv() { - shmid_ds ds; - int id = shmget( 5000, 1024, IPC_CREAT | IPC_EXCL | 0600 ); - if ( id == -1 ) { - cerr << "Error on shmget" << endl; - } - if ( shmctl( id, IPC_STAT, &ds ) == -1 ) { - cerr << "Error on shmctl" << endl; - } - void *buf = shmat( id, 0, 0 ); - if ( buf == reinterpret_cast<void *>(-1) ) { - cerr << "Error on shmat" << endl; - } + const char fname[] = "/tmp/sockios_test.shm"; + try { + xmt::shm_alloc<0> seg; - sem2 = new( buf ) Semaphore( 2, true ); + seg.allocate( fname, 4*4096, xmt::shm_base::create | xmt::shm_base::exclusive, 0600 ); + xmt::allocator_shm<xmt::__Semaphore<true>,0> shm; - sockmgr_stream_MP<ConnectionProcessor6> srv( ::port ); + sem2 = new ( shm.allocate( 1 ) ) xmt::__Semaphore<true>( 2 ); - { - // It should work as before system call... - sockstream s( "localhost", ::port ); + sockmgr_stream_MP<ConnectionProcessor6> srv( ::port ); - s << "1" << endl; + { + // It should work as before system call... + sockstream s( "localhost", ::port ); - BOOST_CHECK( s.good() ); + s << "1" << endl; - sem2->wait(); - } + BOOST_CHECK( s.good() ); - system( "echo > /dev/null" ); // <------ key line + sem2->wait(); + } - { - // ... as after system call. - sockstream s( "localhost", ::port ); + system( "echo > /dev/null" ); // <------ key line - s << "1" << endl; + { + // ... as after system call. + sockstream s( "localhost", ::port ); - BOOST_CHECK( s.good() ); + s << "1" << endl; - sem2->wait(); - } + BOOST_CHECK( s.good() ); - BOOST_CHECK( srv.good() ); // server must correctly process interrupt during system call + sem2->wait(); + } - srv.close(); + BOOST_CHECK( srv.good() ); // server must correctly process interrupt during system call - srv.wait(); + srv.close(); - sem2->~Semaphore(); + srv.wait(); - shmdt( buf ); - shmctl( id, IPC_RMID, &ds ); + sem2->~__Semaphore<true>(); + shm.deallocate( sem2, 1 ); + seg.deallocate(); + unlink( fname ); + } + catch ( xmt::shm_bad_alloc& err ) { + BOOST_CHECK_MESSAGE( false, "error report: " << err.what() ); + } } Modified: trunk/complement/explore/test/sockios/sockios_test.cc =================================================================== --- trunk/complement/explore/test/sockios/sockios_test.cc 2007-01-30 15:06:35 UTC (rev 1485) +++ trunk/complement/explore/test/sockios/sockios_test.cc 2007-01-30 15:09:56 UTC (rev 1486) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/18 18:51:17 ptr> +// -*- C++ -*- Time-stamp: <07/01/30 11:45:52 ptr> /* * @@ -21,7 +21,9 @@ #include <arpa/inet.h> -#include <sys/shm.h> +#include <mt/shm.h> + +// #include <sys/shm.h> #include <sys/wait.h> #include <signal.h> @@ -276,79 +278,193 @@ void sockios_test::sigpipe() { - 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; - // } + const char fname[] = "/tmp/sockios_test.shm"; + enum { + in_Child_Condition = 1, + threads_Started_Condition = 2 + }; + try { + xmt::shm_alloc<0> seg; - xmt::__Condition<true>& fcnd = *new( buf ) xmt::__Condition<true>(); - fcnd.set( false ); - xmt::__Condition<true>& tcnd = *new( (char *)buf + sizeof(xmt::__Condition<true>) ) xmt::__Condition<true>(); - tcnd.set( false ); + seg.allocate( fname, 4*4096, xmt::shm_base::create | xmt::shm_base::exclusive, 0600 ); + xmt::shm_name_mgr<0>& nm = seg.name_mgr(); - try { - xmt::fork(); + xmt::allocator_shm<xmt::__Condition<true>,0> shm; - fcnd.try_wait(); + xmt::__Condition<true>& fcnd = *new ( shm.allocate( 1 ) ) xmt::__Condition<true>(); + nm.named( fcnd, in_Child_Condition ); + fcnd.set( false ); + xmt::__Condition<true>& tcnd = *new ( shm.allocate( 1 ) ) xmt::__Condition<true>(); + nm.named( tcnd, threads_Started_Condition ); + tcnd.set( false ); + try { - /* - * This process will be killed, - * so I don't care about safe termination. - */ - xmt::Thread *th1 = new xmt::Thread( client_thr ); - for ( int i = 0; i < 10; ++i ) { - new xmt::Thread( client_thr ); - new xmt::Thread( client_thr ); - new xmt::Thread( client_thr ); - new xmt::Thread( client_thr ); + xmt::fork(); + + fcnd.try_wait(); + + try { + /* + * This process will be killed, + * so I don't care about safe termination. + */ + xmt::Thread *th1 = new xmt::Thread( client_thr ); + for ( int i = 0; i < /* 10 */ 2; ++i ) { + new xmt::Thread( client_thr ); + new xmt::Thread( client_thr ); + new xmt::Thread( client_thr ); + new xmt::Thread( client_thr ); + } + + xmt::delay( xmt::timespec(1,0) ); + + tcnd.set( true ); + + th1->join(); + + exit( 0 ); } + catch ( ... ) { + } + } + catch ( xmt::fork_in_parent& child ) { + try { + xmt::signal_handler( SIGPIPE, &sigpipe_handler ); + sockmgr_stream_MP<loader> srv( port ); - xmt::delay( xmt::timespec(5,0) ); + fcnd.set( true ); - tcnd.set( true ); + tcnd.try_wait(); - th1->join(); + kill( child.pid(), SIGTERM ); - exit( 0 ); + int stat; + waitpid( child.pid(), &stat, 0 ); + + srv.close(); + srv.wait(); + } + catch ( ... ) { + } } - catch ( ... ) { - } + + (&tcnd)->~__Condition<true>(); + shm.deallocate( &tcnd, 1 ); + (&fcnd)->~__Condition<true>(); + shm.deallocate( &fcnd, 1 ); + + seg.deallocate(); + unlink( fname ); } - catch ( xmt::fork_in_parent& child ) { + catch ( xmt::shm_bad_alloc& err ) { + BOOST_CHECK_MESSAGE( false, "error report: " << err.what() ); + } +} + +class long_msg_processor // +{ + public: + long_msg_processor( std::sockstream& ); + + void connect( std::sockstream& ); + void close(); + + static xmt::__Condition<true> *cnd; +}; + +long_msg_processor::long_msg_processor( std::sockstream& ) +{ + cerr << "long_msg_processor::long_msg_processor" << endl; +} + +void long_msg_processor::connect( std::sockstream& s ) +{ + cerr << "long_msg_processor::connect" << endl; + + string l; + + getline( s, l ); + + cerr << "Is good? " << s.good() << endl; +} + +void long_msg_processor::close() +{ + cerr << "long_msg_processor::close()" << endl; + cnd->set( true ); +} + +xmt::__Condition<true> *long_msg_processor::cnd; + +void sockios_test::long_msg_test() +{ + const char fname[] = "/tmp/sockios_test.shm"; + try { + xmt::shm_alloc<0> seg; + + seg.allocate( fname, 4*4096, xmt::shm_base::create | xmt::shm_base::exclusive, 0600 ); + xmt::shm_name_mgr<0>& nm = seg.name_mgr(); + + xmt::allocator_shm<xmt::__Condition<true>,0> shm; + + xmt::__Condition<true>& fcnd = *new ( shm.allocate( 1 ) ) xmt::__Condition<true>(); + fcnd.set( false ); + + xmt::__Condition<true>& srv_cnd = *new ( shm.allocate( 1 ) ) xmt::__Condition<true>(); + srv_cnd.set( false ); + + long_msg_processor::cnd = &srv_cnd; + try { - xmt::signal_handler( SIGPIPE, &sigpipe_handler ); - sockmgr_stream_MP<loader> srv( port ); + xmt::fork(); - fcnd.set( true ); + fcnd.try_wait(); - tcnd.try_wait(); + { + sockstream s( "localhost", port ); - kill( child.pid(), SIGTERM ); + s << "POST /test.php HTTP/1.1\r\n" + << "xmlrequest=<?xml version=\"1.0\"?>\ +<RWRequest><REQUEST domain=\"network\" service=\"ComplexReport\" nocache=\"n\" \ +contact_id=\"1267\" entity=\"1\" filter_entity_id=\"1\" \ +clientName=\"ui.ent\"><ROWS><ROW type=\"group\" priority=\"1\" ref=\"entity_id\" \ +includeascolumn=\"n\"/><ROW type=\"group\" priority=\"2\" \ +ref=\"advertiser_line_item_id\" includeascolumn=\"n\"/><ROW type=\"total\"/></ROWS><COLUMNS><COLUMN \ +ref=\"advertiser_line_item_name\"/><COLUMN ref=\"seller_imps\"/><COLUMN \ +ref=\"seller_clicks\"/><COLUMN ref=\"seller_convs\"/><COLUMN \ +ref=\"click_rate\"/><COLUMN ref=\"conversion_rate\"/><COLUMN ref=\"roi\"/><COLUMN \ +ref=\"network_revenue\"/><COLUMN ref=\"network_gross_cost\"/><COLUMN \ +ref=\"network_gross_profit\"/><COLUMN ref=\"network_revenue_ecpm\"/><COLUMN \ +ref=\"network_gross_cost_ecpm\"/><COLUMN \ +ref=\"network_gross_profit_ecpm\"/></COLUMNS><FILTERS><FILTER ref=\"time\" \ +macro=\"yesterday\"/></FILTERS></REQUEST></RWRequest>"; + s.flush(); + } + exit( 0 ); + } + catch ( xmt::fork_in_parent& child ) { + sockmgr_stream_MP<long_msg_processor> srv( port ); + fcnd.set( true ); - int stat; - waitpid( child.pid(), &stat, 0 ); + srv_cnd.try_wait(); srv.close(); srv.wait(); + } - catch ( ... ) { - } + + (&fcnd)->~__Condition<true>(); + shm.deallocate( &fcnd, 1 ); + + (&srv_cnd)->~__Condition<true>(); + shm.deallocate( &srv_cnd, 1 ); + + seg.deallocate(); + unlink( fname ); } + catch ( xmt::shm_bad_alloc& err ) { + BOOST_CHECK_MESSAGE( false, "error report: " << err.what() ); + } - (&fcnd)->~__Condition<true>(); - - shmdt( buf ); - shmctl( id, IPC_RMID, &ds ); } Modified: trunk/complement/explore/test/sockios/sockios_test.h =================================================================== --- trunk/complement/explore/test/sockios/sockios_test.h 2007-01-30 15:06:35 UTC (rev 1485) +++ trunk/complement/explore/test/sockios/sockios_test.h 2007-01-30 15:09:56 UTC (rev 1486) @@ -1,8 +1,8 @@ -// -*- C++ -*- Time-stamp: <06/12/18 16:54:00 ptr> +// -*- C++ -*- Time-stamp: <07/01/30 10:55:51 ptr> /* * - * Copyright (c) 2002, 2003, 2005, 2006 + * Copyright (c) 2002, 2003, 2005, 2006, 2007 * Petr Ovtchenkov * * Licensed under the Academic Free License version 3.0 @@ -24,6 +24,7 @@ void ctor_dtor(); void sigpipe(); + void long_msg_test(); }; #endif // __sockios_test_h Modified: trunk/complement/explore/test/sockios/sockios_test_suite.cc =================================================================== --- trunk/complement/explore/test/sockios/sockios_test_suite.cc 2007-01-30 15:06:35 UTC (rev 1485) +++ trunk/complement/explore/test/sockios/sockios_test_suite.cc 2007-01-30 15:09:56 UTC (rev 1486) @@ -1,8 +1,8 @@ -// -*- C++ -*- Time-stamp: <06/12/18 17:10:02 ptr> +// -*- C++ -*- Time-stamp: <07/01/30 10:57:38 ptr> /* * - * Copyright (c) 2002, 2003, 2005, 2006 + * Copyright (c) 2002, 2003, 2005, 2006, 2007 * Petr Ovtchenkov * * Licensed under the Academic Free License version 3.0 @@ -29,6 +29,7 @@ test_case *hostaddr3_tc = BOOST_CLASS_TEST_CASE( &sockios_test::hostaddr_test3, instance ); test_case *ctor_dtor_tc = BOOST_CLASS_TEST_CASE( &sockios_test::ctor_dtor, instance ); test_case *sigpipe_tc = BOOST_CLASS_TEST_CASE( &sockios_test::sigpipe, instance ); + test_case *long_msg_tc = BOOST_CLASS_TEST_CASE( &sockios_test::long_msg_test, instance ); // hostaddr2_tc->depends_on( hostaddr1_tc ); @@ -40,4 +41,5 @@ add( hostaddr3_tc ); add( ctor_dtor_tc ); add( sigpipe_tc ); + add( long_msg_tc ); } Modified: trunk/complement/explore/test/sockios/unit_test.cc =================================================================== --- trunk/complement/explore/test/sockios/unit_test.cc 2007-01-30 15:06:35 UTC (rev 1485) +++ trunk/complement/explore/test/sockios/unit_test.cc 2007-01-30 15:09:56 UTC (rev 1486) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/18 16:41:59 ptr> +// -*- C++ -*- Time-stamp: <07/01/29 19:19:10 ptr> /* * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-30 15:06:45
|
Revision: 1485 http://svn.sourceforge.net/complement/?rev=1485&view=rev Author: complement Date: 2007-01-30 07:06:35 -0800 (Tue, 30 Jan 2007) Log Message: ----------- named object manager for shared memory segment Modified Paths: -------------- trunk/complement/explore/include/mt/shm.h trunk/complement/explore/lib/mt/ChangeLog 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 Modified: trunk/complement/explore/include/mt/shm.h =================================================================== --- trunk/complement/explore/include/mt/shm.h 2007-01-30 15:04:59 UTC (rev 1484) +++ trunk/complement/explore/include/mt/shm.h 2007-01-30 15:06:35 UTC (rev 1485) @@ -1,7 +1,7 @@ -// -*- C++ -*- Time-stamp: <06/12/26 10:24:35 ptr> +// -*- C++ -*- Time-stamp: <07/01/29 18:59:35 ptr> /* - * Copyright (c) 2006 + * Copyright (c) 2006, 2007 * Petr Ovtchenkov * * Licensed under the Academic Free License version 3.0 @@ -69,6 +69,30 @@ typedef typename std::__type_traits<T>::is_POD_type is_ipc_sharable; }; +template <> +struct ipc_sharable<xmt::__Condition<true> > +{ + typedef std::__true_type is_ipc_sharable; +}; + +template <> +struct ipc_sharable<xmt::__Semaphore<true> > +{ + typedef std::__true_type is_ipc_sharable; +}; + +template <> +struct ipc_sharable<xmt::__Mutex<false,true> > +{ + typedef std::__true_type is_ipc_sharable; +}; + +template <> +struct ipc_sharable<xmt::__Mutex<true,true> > +{ + typedef std::__true_type is_ipc_sharable; +}; + template <int _Inst> class shm_alloc; namespace detail { @@ -277,11 +301,11 @@ if ( _last == 255 ) { throw std::range_error( "too many named objects" ); } - if ( (reinterpret_cast<void *>(&obj) <= shm_alloc<_Inst>::_seg.address()) || - (reinterpret_cast<void *>(&obj) > (reinterpret_cast<char *>(shm_alloc<_Inst>::_seg.address()) + + if ( (reinterpret_cast<const void *>(&obj) <= shm_alloc<_Inst>::_seg.address()) || + (reinterpret_cast<const void *>(&obj) > (reinterpret_cast<char *>(shm_alloc<_Inst>::_seg.address()) + shm_alloc<_Inst>::max_size() + - sizeof(shm_alloc<_Inst>::_master) + - sizeof(shm_alloc<_Inst>::_aheader) )) ) { + sizeof(typename shm_alloc<_Inst>::_master) + + sizeof(typename shm_alloc<_Inst>::_aheader) )) ) { throw std::invalid_argument( std::string("object beyond this shared segment") ); } for ( int i = 0; _nm_table[i].name != -1; ++i ) { @@ -290,7 +314,7 @@ } } _nm_table[_last].name = name; - _nm_table[_last].offset = reinterpret_cast<char *>(&obj) - reinterpret_cast<char *>(shm_alloc<_Inst>::_seg.address()); + _nm_table[_last].offset = reinterpret_cast<const char *>(&obj) - reinterpret_cast<char *>(shm_alloc<_Inst>::_seg.address()); _nm_table[_last].count = 1; ++_last; } @@ -444,6 +468,23 @@ static size_type max_size() throw() { return _seg.max_size() == 0 ? 0 : (_seg.max_size() - sizeof(_master) - sizeof(_aheader)); } + static shm_name_mgr<_Inst>& name_mgr() + { + pointer p = _seg.address(); + if ( p != reinterpret_cast<pointer>(-1) ) { + _master *m = reinterpret_cast<_master *>( p ); + if ( m->_nm == 0 ) { + xmt::__Locker<xmt::__Mutex<false,true> > lk( m->_lock ); + void *nm = _traverse( &m->_first, sizeof(shm_name_mgr<_Inst>) ); + m->_nm = reinterpret_cast<char *>(nm) - reinterpret_cast<char *>(p); + return *new ( nm ) shm_name_mgr<_Inst>(); + } + return *reinterpret_cast<shm_name_mgr<_Inst> *>(reinterpret_cast<char *>(p) + m->_nm); + } + + throw shm_bad_alloc( -2 ); + } + protected: static void *allocate( size_type n, void *hint = 0 ) { Modified: trunk/complement/explore/lib/mt/ChangeLog =================================================================== --- trunk/complement/explore/lib/mt/ChangeLog 2007-01-30 15:04:59 UTC (rev 1484) +++ trunk/complement/explore/lib/mt/ChangeLog 2007-01-30 15:06:35 UTC (rev 1485) @@ -1,3 +1,11 @@ +2007-01-30 Petr Ovtchenkov <pt...@is...> + + * shm.h: add named objects manager in shared segment + memory allocator; + + * xmt.h, xmt.cc: unification Semaphore with Condition + and Mutex---ipc flag passed as template parameter. + 2006-12-26 Petr Ovtchenkov <pt...@is...> * shm.h, shm.cc: shared memory-based allocator Modified: trunk/complement/explore/test/mt/mt_test.cc =================================================================== --- trunk/complement/explore/test/mt/mt_test.cc 2007-01-30 15:04:59 UTC (rev 1484) +++ trunk/complement/explore/test/mt/mt_test.cc 2007-01-30 15:06:35 UTC (rev 1485) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/26 10:45:51 ptr> +// -*- C++ -*- Time-stamp: <07/01/29 15:35:05 ptr> /* * Copyright (c) 2006 @@ -288,3 +288,137 @@ } } + +/* + * This test is similar mt_test::fork() above, but instead plain shm_* + * functions it use allocator based on shared memory segment + */ +void mt_test::fork_shm() +{ + const char fname[] = "/tmp/mt_test.shm"; + try { + xmt::shm_alloc<0> seg; + + seg.allocate( fname, 1024, xmt::shm_base::create | xmt::shm_base::exclusive, 0660 ); + xmt::allocator_shm<char,0> shm; + + xmt::__Condition<true>& fcnd = *new( shm.allocate( sizeof(xmt::__Condition<true>) ) ) xmt::__Condition<true>(); + fcnd.set( false ); + try { + xmt::fork(); + + try { + + // Child code + fcnd.try_wait(); + + } + 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>(); + shm.deallocate( reinterpret_cast<char *>(&fcnd), sizeof(xmt::__Condition<true>) ); + seg.deallocate(); + fs::remove( fname ); + } + catch ( xmt::shm_bad_alloc& err ) { + BOOST_CHECK_MESSAGE( false, "error report: " << err.what() ); + } +} + +/* + * Test: how to take named object + */ +void mt_test::shm_named_obj() +{ + const char fname[] = "/tmp/mt_test.shm"; + enum { + test_Condition_Object = 1 + }; + try { + xmt::shm_alloc<0> seg; + + seg.allocate( fname, 4*4096, xmt::shm_base::create | xmt::shm_base::exclusive, 0660 ); + xmt::shm_name_mgr<0>& nm = seg.name_mgr(); + + xmt::allocator_shm<xmt::__Condition<true>,0> shm; + + xmt::__Condition<true>& fcnd = *new ( shm.allocate( 1 ) ) xmt::__Condition<true>(); + nm.named( fcnd, test_Condition_Object ); + fcnd.set( false ); + + try { + xmt::fork(); + + try { + + // Child code + xmt::shm_alloc<0> seg_ch; + + if ( seg_ch.max_size() == 0 ) { // just illustration, if seg and seg_ch + // (really xmt::shm_alloc<0>) + // in totally different address spaces + // in our case xmt::shm_name_mgr<0> instance derived from parent + // process + seg.allocate( fname, 4*4096, 0, 0660 ); + } + + xmt::shm_name_mgr<0>& nm_ch = seg_ch.name_mgr(); + xmt::__Condition<true>& fcnd_ch = nm_ch.named<xmt::__Condition<true> >( test_Condition_Object ); + fcnd_ch.set( true ); + } + catch ( const xmt::shm_bad_alloc& err ) { + BOOST_CHECK_MESSAGE( false, "Fail in child: " << err.what() ); + } + catch ( const std::invalid_argument& err ) { + BOOST_CHECK_MESSAGE( false, "Fail in child: " << err.what() ); + } + catch ( ... ) { + BOOST_CHECK_MESSAGE( false, "Fail in child" ); + } + + exit( 0 ); + } + catch ( xmt::fork_in_parent& child ) { + try { + BOOST_CHECK( child.pid() > 0 ); + + fcnd.try_wait(); + + int stat; + BOOST_CHECK( waitpid( child.pid(), &stat, 0 ) == child.pid() ); + } + catch ( ... ) { + BOOST_CHECK_MESSAGE( false, "Fail in parent" ); + } + } + catch ( ... ) { + BOOST_CHECK_MESSAGE( false, "Fail in fork" ); + } + + (&fcnd)->~__Condition<true>(); + shm.deallocate( &fcnd, 1 ); + seg.deallocate(); + fs::remove( fname ); + } + catch ( xmt::shm_bad_alloc& err ) { + BOOST_CHECK_MESSAGE( false, "error report: " << err.what() ); + } +} Modified: trunk/complement/explore/test/mt/mt_test.h =================================================================== --- trunk/complement/explore/test/mt/mt_test.h 2007-01-30 15:04:59 UTC (rev 1484) +++ trunk/complement/explore/test/mt/mt_test.h 2007-01-30 15:06:35 UTC (rev 1485) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/18 19:49:04 ptr> +// -*- C++ -*- Time-stamp: <07/01/29 13:49:41 ptr> /* * Copyright (c) 2006 @@ -17,6 +17,8 @@ void pid(); void shm_segment(); void shm_alloc(); + void fork_shm(); + void shm_named_obj(); }; #endif // __MT_TEST_H Modified: trunk/complement/explore/test/mt/mt_test_suite.cc =================================================================== --- trunk/complement/explore/test/mt/mt_test_suite.cc 2007-01-30 15:04:59 UTC (rev 1484) +++ trunk/complement/explore/test/mt/mt_test_suite.cc 2007-01-30 15:06:35 UTC (rev 1485) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/18 19:58:56 ptr> +// -*- C++ -*- Time-stamp: <07/01/29 15:36:45 ptr> /* * Copyright (c) 2006 @@ -22,12 +22,18 @@ test_case *pid_tc = BOOST_CLASS_TEST_CASE( &mt_test::pid, instance ); test_case *shm_segment_tc = BOOST_CLASS_TEST_CASE( &mt_test::shm_segment, instance ); test_case *shm_alloc_tc = BOOST_CLASS_TEST_CASE( &mt_test::shm_alloc, instance ); + test_case *fork_shm_tc = BOOST_CLASS_TEST_CASE( &mt_test::fork_shm, instance ); + test_case *shm_nm_obj_tc = BOOST_CLASS_TEST_CASE( &mt_test::shm_named_obj, instance ); pid_tc->depends_on( fork_tc ); shm_alloc_tc->depends_on( shm_segment_tc ); + fork_shm_tc->depends_on( shm_alloc_tc ); + shm_nm_obj_tc->depends_on( fork_shm_tc ); add( fork_tc ); add( pid_tc ); add( shm_segment_tc ); add( shm_alloc_tc ); + add( fork_shm_tc, 0, 5 ); + add( shm_nm_obj_tc, 0, 5 ); }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-30 15:05:06
|
Revision: 1484 http://svn.sourceforge.net/complement/?rev=1484&view=rev Author: complement Date: 2007-01-30 07:04:59 -0800 (Tue, 30 Jan 2007) Log Message: ----------- pass ipc flag as template parameter for Semaphor Modified Paths: -------------- trunk/complement/explore/include/mt/xmt.h trunk/complement/explore/lib/mt/xmt.cc Modified: trunk/complement/explore/include/mt/xmt.h =================================================================== --- trunk/complement/explore/include/mt/xmt.h 2007-01-26 15:44:50 UTC (rev 1483) +++ trunk/complement/explore/include/mt/xmt.h 2007-01-30 15:04:59 UTC (rev 1484) @@ -1,7 +1,7 @@ -// -*- C++ -*- Time-stamp: <06/12/15 14:35:45 ptr> +// -*- C++ -*- Time-stamp: <07/01/29 18:58:49 ptr> /* - * Copyright (c) 1997-1999, 2002-2006 + * Copyright (c) 1997-1999, 2002-2007 * Petr Ovtchenkov * * Portion Copyright (c) 1999-2001 @@ -1266,27 +1266,28 @@ typedef __Condition<false> Condition; -class Semaphore +template <bool SCOPE> +class __Semaphore { public: - Semaphore( int cnt = 1, bool ipc = false ) + __Semaphore( int cnt = 1 ) { #ifdef __FIT_WIN32THREADS _sem = CreateSemaphore( NULL, cnt, INT_MAX, 0 ); // check! _cnt = cnt; #endif #ifdef __FIT_UITHREADS - sema_init( &_sem, cnt, ipc ? USYNC_PROCESS : USYNC_THREAD, 0 ); + sema_init( &_sem, cnt, SCOPE ? USYNC_PROCESS : USYNC_THREAD, 0 ); #endif #ifdef _PTHREADS - sem_init( &_sem, ipc ? 1 : 0, cnt ); + sem_init( &_sem, SCOPE ? 1 : 0, cnt ); #endif #ifdef __FIT_NOVELL_THREADS _sem = OpenLocalSemaphore( cnt ); #endif } - ~Semaphore() + ~__Semaphore() { #ifdef __FIT_WIN32THREADS CloseHandle( _sem ); @@ -1396,10 +1397,76 @@ LONG _sem; #endif private: - Semaphore( const Semaphore& ) + __Semaphore( const __Semaphore& ) { } }; +typedef __Semaphore<false> Semaphore; + +template <bool SCOPE> +int __Semaphore<SCOPE>::wait_time( const ::timespec *abstime ) // wait for time t, or signal +{ +#ifdef __FIT_WIN32THREADS + time_t ct = time( 0 ); + time_t _conv = abstime->tv_sec * 1000 + abstime->tv_nsec / 1000000; + + unsigned ms = _conv >= ct ? _conv - ct : 1; + + if ( WaitForSingleObject( _sem, ms ) == WAIT_OBJECT_0 ) { + return 0; + } + return -1; +#endif +#ifdef __FIT_UITHREADS +#warning "Fix me!" +#endif +#ifdef _PTHREADS +# if !(defined(__FreeBSD__) || defined(__OpenBSD__)) + return sem_timedwait( &_sem, abstime ); +# else + return -1; // not implemented +# endif +#endif +#ifdef __FIT_NOVELL_THREADS + time_t ct = time( 0 ); + time_t _conv = abstime->tv_sec * 1000 + abstime->tv_nsec / 1000000; + + unsigned ms = _conv >= ct ? _conv - ct : 1; + return TimedWaitOnLocalSemaphore( _sem, ms ); +#endif +} + +template <bool SCOPE> +int __Semaphore<SCOPE>::wait_delay( const ::timespec *interval ) // wait, timeout is delay t, or signal +{ +#ifdef __FIT_WIN32THREADS + unsigned ms = interval->tv_sec * 1000 + interval->tv_nsec / 1000000; + + if ( WaitForSingleObject( _sem, ms ) == WAIT_OBJECT_0 ) { + return 0; + } + return -1; +#endif +#ifdef __FIT_UITHREADS +#warning "Fix me!" +#endif +#ifdef _PTHREADS + timespec st; + xmt::gettime( &st ); + st += *interval; +# if !(defined(__FreeBSD__) || defined(__OpenBSD__)) + return sem_timedwait( &_sem, &st ); +# else + return -1; // not implemented +# endif +#endif +#ifdef __FIT_NOVELL_THREADS + unsigned ms = interval->tv_sec * 1000 + interval->tv_nsec / 1000000; + return TimedWaitOnLocalSemaphore( _sem, ms ); +#endif +} + + __FIT_DECLSPEC void fork() throw( fork_in_parent, std::runtime_error ); __FIT_DECLSPEC void become_daemon() throw( fork_in_parent, std::runtime_error ); __FIT_DECLSPEC void block_signal( int sig ); Modified: trunk/complement/explore/lib/mt/xmt.cc =================================================================== --- trunk/complement/explore/lib/mt/xmt.cc 2007-01-26 15:44:50 UTC (rev 1483) +++ trunk/complement/explore/lib/mt/xmt.cc 2007-01-30 15:04:59 UTC (rev 1484) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/15 14:39:47 ptr> +// -*- C++ -*- Time-stamp: <07/01/29 18:53:22 ptr> /* * Copyright (c) 1997-1999, 2002-2006 @@ -169,70 +169,6 @@ using std::endl; #endif - -__FIT_DECLSPEC -int Semaphore::wait_time( const ::timespec *abstime ) // wait for time t, or signal -{ -#ifdef __FIT_WIN32THREADS - time_t ct = time( 0 ); - time_t _conv = abstime->tv_sec * 1000 + abstime->tv_nsec / 1000000; - - unsigned ms = _conv >= ct ? _conv - ct : 1; - - if ( WaitForSingleObject( _sem, ms ) == WAIT_OBJECT_0 ) { - return 0; - } - return -1; -#endif -#ifdef __FIT_UITHREADS -#warning "Fix me!" -#endif -#ifdef _PTHREADS -# if !(defined(__FreeBSD__) || defined(__OpenBSD__)) - return sem_timedwait( &_sem, abstime ); -# else - return -1; // not implemented -# endif -#endif -#ifdef __FIT_NOVELL_THREADS - time_t ct = time( 0 ); - time_t _conv = abstime->tv_sec * 1000 + abstime->tv_nsec / 1000000; - - unsigned ms = _conv >= ct ? _conv - ct : 1; - return TimedWaitOnLocalSemaphore( _sem, ms ); -#endif -} - -__FIT_DECLSPEC -int Semaphore::wait_delay( const ::timespec *interval ) // wait, timeout is delay t, or signal -{ -#ifdef __FIT_WIN32THREADS - unsigned ms = interval->tv_sec * 1000 + interval->tv_nsec / 1000000; - - if ( WaitForSingleObject( _sem, ms ) == WAIT_OBJECT_0 ) { - return 0; - } - return -1; -#endif -#ifdef __FIT_UITHREADS -#warning "Fix me!" -#endif -#ifdef _PTHREADS - timespec st; - xmt::gettime( &st ); - st += *interval; -# if !(defined(__FreeBSD__) || defined(__OpenBSD__)) - return sem_timedwait( &_sem, &st ); -# else - return -1; // not implemented -# endif -#endif -#ifdef __FIT_NOVELL_THREADS - unsigned ms = interval->tv_sec * 1000 + interval->tv_nsec / 1000000; - return TimedWaitOnLocalSemaphore( _sem, ms ); -#endif -} - char *Init_buf[32]; int& Thread::Init::_count( detail::Init_count ); // trick to avoid friend declarations This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-26 15:44:52
|
Revision: 1483 http://svn.sourceforge.net/complement/?rev=1483&view=rev Author: complement Date: 2007-01-26 07:44:50 -0800 (Fri, 26 Jan 2007) Log Message: ----------- complement snapshot, 2007-01-26 Added Paths: ----------- tags/complement-20070126/ Copied: tags/complement-20070126 (from rev 1482, trunk/complement) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-26 15:44:34
|
Revision: 1482 http://svn.sourceforge.net/complement/?rev=1482&view=rev Author: complement Date: 2007-01-26 07:44:30 -0800 (Fri, 26 Jan 2007) Log Message: ----------- clean Removed Paths: ------------- tags/complement-20070126/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-26 15:43:51
|
Revision: 1481 http://svn.sourceforge.net/complement/?rev=1481&view=rev Author: complement Date: 2007-01-26 07:43:49 -0800 (Fri, 26 Jan 2007) Log Message: ----------- fix check-* targets; change link options to allow tests before install Modified Paths: -------------- trunk/complement/explore/lib/mt/Makefile trunk/complement/explore/lib/sockios/Makefile trunk/complement/explore/lib/stem/Makefile trunk/complement/explore/test/mt/Makefile trunk/complement/explore/test/sockios/Makefile trunk/complement/explore/test/stem/Makefile Modified: trunk/complement/explore/lib/mt/Makefile =================================================================== --- trunk/complement/explore/lib/mt/Makefile 2007-01-26 13:58:54 UTC (rev 1480) +++ trunk/complement/explore/lib/mt/Makefile 2007-01-26 15:43:49 UTC (rev 1481) @@ -7,22 +7,22 @@ INCLUDES += -I$(SRCROOT)/include -check: install +check: all-shared $(MAKE) -C ../../test/mt (cd ../../test/mt; ${OUTPUT_DIR}/mt_ut) || exit 1 (cd ../../test/mt; ${OUTPUT_DIR_DBG}/mt_ut) || exit 1 (cd ../../test/mt; ${OUTPUT_DIR_STLDBG}/mt_ut) || exit 1 -check-release: install-release-shared +check-release-shared: release-shared $(MAKE) -C ../../test/mt release-shared (cd ../../test/mt; ${OUTPUT_DIR}/mt_ut) || exit 1 -check-dbg: install-dbg-shared +check-dbg-shared: dbg-shared $(MAKE) -C ../../test/mt dbg-shared (cd ../../test/mt; ${OUTPUT_DIR_DBG}/mt_ut) || exit 1 ifndef WITHOUT_STLPORT -check-stldbg: install-stldbg-shared +check-stldbg-shared: stldbg-shared $(MAKE) -C ../../test/mt stldbg-shared (cd ../../test/mt; ${OUTPUT_DIR_STLDBG}/mt_ut) || exit 1 endif Modified: trunk/complement/explore/lib/sockios/Makefile =================================================================== --- trunk/complement/explore/lib/sockios/Makefile 2007-01-26 13:58:54 UTC (rev 1480) +++ trunk/complement/explore/lib/sockios/Makefile 2007-01-26 15:43:49 UTC (rev 1481) @@ -8,22 +8,22 @@ INCLUDES += -I$(SRCROOT)/include -check: install +check: all-shared $(MAKE) -C ../../test/sockios (cd ../../test/sockios; ${OUTPUT_DIR}/sockios_ut) || exit 1 (cd ../../test/sockios; ${OUTPUT_DIR_DBG}/sockios_ut) || exit 1 (cd ../../test/sockios; ${OUTPUT_DIR_STLDBG}/sockios_ut) || exit 1 -check-release: install-release-shared +check-release-shared: release-shared $(MAKE) -C ../../test/sockios release-shared (cd ../../test/sockios; ${OUTPUT_DIR}/sockios_ut) || exit 1 -check-dbg: install-dbg-shared +check-dbg-shared: dbg-shared $(MAKE) -C ../../test/sockios dbg-shared (cd ../../test/sockios; ${OUTPUT_DIR_DBG}/sockios_ut) || exit 1 ifndef WITHOUT_STLPORT -check-stldbg: install-stldbg-shared +check-stldbg-shared: stldbg-shared $(MAKE) -C ../../test/sockios stldbg-shared (cd ../../test/sockios; ${OUTPUT_DIR_STLDBG}/sockios_ut) || exit 1 endif Modified: trunk/complement/explore/lib/stem/Makefile =================================================================== --- trunk/complement/explore/lib/stem/Makefile 2007-01-26 13:58:54 UTC (rev 1480) +++ trunk/complement/explore/lib/stem/Makefile 2007-01-26 15:43:49 UTC (rev 1481) @@ -16,22 +16,22 @@ stldbg-shared: DEFS += -D__FIT_STEM_TRACE=1 endif -check: install +check: all-shared $(MAKE) -C ../../test/stem (cd ../../test/stem; ${OUTPUT_DIR}/stem_ut) || exit 1 (cd ../../test/stem; ${OUTPUT_DIR_DBG}/stem_ut) || exit 1 (cd ../../test/stem; ${OUTPUT_DIR_STLDBG}/stem_ut) || exit 1 -check-release: install-release-shared +check-release-shared: release-shared $(MAKE) -C ../../test/stem release-shared (cd ../../test/stem; ${OUTPUT_DIR}/stem_ut) || exit 1 -check-dbg: install-dbg-shared +check-dbg-shared: dbg-shared $(MAKE) -C ../../test/stem dbg-shared (cd ../../test/stem; ${OUTPUT_DIR_DBG}/stem_ut) || exit 1 ifndef WITHOUT_STLPORT -check-stldbg: install-stldbg-shared +check-stldbg-shared: stldbg-shared $(MAKE) -C ../../test/stem stldbg-shared (cd ../../test/stem; ${OUTPUT_DIR_STLDBG}/stem_ut) || exit 1 endif Modified: trunk/complement/explore/test/mt/Makefile =================================================================== --- trunk/complement/explore/test/mt/Makefile 2007-01-26 13:58:54 UTC (rev 1480) +++ trunk/complement/explore/test/mt/Makefile 2007-01-26 15:43:49 UTC (rev 1481) @@ -17,16 +17,20 @@ # RPATH := ${RPATH}:$(realpath ${STLPORT_LIB_DIR}):$(realpath /usr/lib) # endif +LIBMT_DIR = ${CoMT_DIR}/lib/mt +LIBUTF_DIR = ${CoMT_DIR}/../extern/custom/boost/libs/test/unit_test_framework +LIBFS_DIR = ${CoMT_DIR}/../extern/custom/boost/libs/filesystem + ifeq ($(OSNAME),linux) -release-shared: LDSEARCH += -L${CoMT_LIB_DIR} -Wl,--rpath=${CoMT_LIB_DIR}:${STLPORT_LIB_DIR} -stldbg-shared: LDSEARCH += -L${CoMT_LIB_DIR_STLDBG} -Wl,--rpath=${CoMT_LIB_DIR_STLDBG}:${STLPORT_LIB_DIR} -dbg-shared: LDSEARCH += -L${CoMT_LIB_DIR_DBG} -Wl,--rpath=${CoMT_LIB_DIR_DBG}:${STLPORT_LIB_DIR} +release-shared: LDSEARCH += -L${LIBMT_DIR}/${OUTPUT_DIR} -L${LIBUTF_DIR}/${OUTPUT_DIR} -L${LIBFS_DIR}/${OUTPUT_DIR} -Wl,--rpath=${LIBMT_DIR}/${OUTPUT_DIR}:${LIBUTF_DIR}/${OUTPUT_DIR}:${LIBFS_DIR}/${OUTPUT_DIR}:${STLPORT_LIB_DIR} +stldbg-shared: LDSEARCH += -L${LIBMT_DIR}/${OUTPUT_DIR_STLDBG} -L${LIBUTF_DIR}/${OUTPUT_DIR_STLDBG} -L${LIBFS_DIR}/${OUTPUT_DIR_STLDBG} -Wl,--rpath=${LIBMT_DIR}/${OUTPUT_DIR_STLDBG}:${LIBUTF_DIR}/${OUTPUT_DIR_STLDBG}:${LIBFS_DIR}/${OUTPUT_DIR_STLDBG}:${STLPORT_LIB_DIR} +dbg-shared: LDSEARCH += -L${LIBMT_DIR}/${OUTPUT_DIR_DBG} -L${LIBUTF_DIR}/${OUTPUT_DIR_DBG} -L${LIBFS_DIR}/${OUTPUT_DIR_DBG} -Wl,--rpath=${LIBMT_DIR}/${OUTPUT_DIR_DBG}:${LIBUTF_DIR}/${OUTPUT_DIR_DBG}:${LIBFS_DIR}/${OUTPUT_DIR_DBG}:${STLPORT_LIB_DIR} endif ifeq ($(OSNAME),openbsd) -release-shared: LDSEARCH += -L${CoMT_LIB_DIR} -Wl,-R${CoMT_LIB_DIR}:${STLPORT_LIB_DIR} -stldbg-shared: LDSEARCH += -L${CoMT_LIB_DIR_STLDBG} -Wl,-R${CoMT_LIB_DIR_STLDBG}:${STLPORT_LIB_DIR} -dbg-shared: LDSEARCH += -L${CoMT_LIB_DIR_DBG} -Wl,-R${CoMT_LIB_DIR_DBG}:${STLPORT_LIB_DIR} +release-shared: LDSEARCH += -L${LIBMT_DIR}/${OUTPUT_DIR} -Wl,-R${LIBMT_DIR}/${OUTPUT_DIR}:${STLPORT_LIB_DIR} +stldbg-shared: LDSEARCH += -L${LIBMT_DIR}/${OUTPUT_DIR_STLDBG} -Wl,-R${LIBMT_DIR}/${OUTPUT_DIR_STLDBG}:${STLPORT_LIB_DIR} +dbg-shared: LDSEARCH += -L${LIBMT_DIR}/${OUTPUT_DIR_DBG} -Wl,-R${LIBMT_DIR}/${OUTPUT_DIR_DBG}:${STLPORT_LIB_DIR} endif release-shared : LDLIBS = -lxmt -lboost_test_utf -lboost_fs Modified: trunk/complement/explore/test/sockios/Makefile =================================================================== --- trunk/complement/explore/test/sockios/Makefile 2007-01-26 13:58:54 UTC (rev 1480) +++ trunk/complement/explore/test/sockios/Makefile 2007-01-26 15:43:49 UTC (rev 1481) @@ -9,10 +9,16 @@ INCLUDES += -I$(SRCROOT)/include -I$(BOOST_INCLUDE_DIR) -LDSEARCH += -L${CoMT_LIB_DIR} +LIBMT_DIR = ${CoMT_DIR}/lib/mt +LIBSOCK_DIR = ${CoMT_DIR}/lib/sockios +LIBUTF_DIR = ${CoMT_DIR}/../extern/custom/boost/libs/test/unit_test_framework +ifeq ($(OSNAME),linux) +release-shared: LDSEARCH += -L${LIBMT_DIR}/${OUTPUT_DIR} -L${LIBUTF_DIR}/${OUTPUT_DIR} -L${LIBSOCK_DIR}/${OUTPUT_DIR} -Wl,--rpath=${LIBMT_DIR}/${OUTPUT_DIR}:${LIBUTF_DIR}/${OUTPUT_DIR}:${LIBSOCK_DIR}/${OUTPUT_DIR}:${STLPORT_LIB_DIR} +stldbg-shared: LDSEARCH += -L${LIBMT_DIR}/${OUTPUT_DIR_STLDBG} -L${LIBUTF_DIR}/${OUTPUT_DIR_STLDBG} -L${LIBSOCK_DIR}/${OUTPUT_DIR_STLDBG} -Wl,--rpath=${LIBMT_DIR}/${OUTPUT_DIR_STLDBG}:${LIBUTF_DIR}/${OUTPUT_DIR_STLDBG}:${LIBSOCK_DIR}/${OUTPUT_DIR_STLDBG}:${STLPORT_LIB_DIR} +dbg-shared: LDSEARCH += -L${LIBMT_DIR}/${OUTPUT_DIR_DBG} -L${LIBUTF_DIR}/${OUTPUT_DIR_DBG} -L${LIBSOCK_DIR}/${OUTPUT_DIR_DBG} -Wl,--rpath=${LIBMT_DIR}/${OUTPUT_DIR_DBG}:${LIBUTF_DIR}/${OUTPUT_DIR_DBG}:${LIBSOCK_DIR}/${OUTPUT_DIR_DBG}:${STLPORT_LIB_DIR} +endif + release-shared : LDLIBS = -lxmt -lsockios -lboost_test_utf stldbg-shared : LDLIBS = -lxmtstlg -lsockiosstlg -lboost_test_utfstlg dbg-shared : LDLIBS = -lxmtg -lsockiosg -lboost_test_utfg - -LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR}:${CoMT_LIB_DIR} Modified: trunk/complement/explore/test/stem/Makefile =================================================================== --- trunk/complement/explore/test/stem/Makefile 2007-01-26 13:58:54 UTC (rev 1480) +++ trunk/complement/explore/test/stem/Makefile 2007-01-26 15:43:49 UTC (rev 1481) @@ -10,19 +10,25 @@ include Makefile.inc include ${SRCROOT}/Makefiles/top.mak - INCLUDES += -I$(SRCROOT)/include -I$(BOOST_INCLUDE_DIR) -LDSEARCH = -L${STLPORT_LIB_DIR} -L${CoMT_LIB_DIR} +LIBMT_DIR = ${CoMT_DIR}/lib/mt +LIBSOCK_DIR = ${CoMT_DIR}/lib/sockios +LIBSTEM_DIR = ${CoMT_DIR}/lib/stem +LIBUTF_DIR = ${CoMT_DIR}/../extern/custom/boost/libs/test/unit_test_framework +ifeq ($(OSNAME),linux) +release-shared: LDSEARCH += -L${LIBMT_DIR}/${OUTPUT_DIR} -L${LIBUTF_DIR}/${OUTPUT_DIR} -L${LIBSOCK_DIR}/${OUTPUT_DIR} -L${LIBSTEM_DIR}/${OUTPUT_DIR} -Wl,--rpath=${LIBMT_DIR}/${OUTPUT_DIR}:${LIBUTF_DIR}/${OUTPUT_DIR}:${LIBSOCK_DIR}/${OUTPUT_DIR}:${LIBSTEM_DIR}/${OUTPUT_DIR}:${STLPORT_LIB_DIR} +stldbg-shared: LDSEARCH += -L${LIBMT_DIR}/${OUTPUT_DIR_STLDBG} -L${LIBUTF_DIR}/${OUTPUT_DIR_STLDBG} -L${LIBSOCK_DIR}/${OUTPUT_DIR_STLDBG} -L${LIBSTEM_DIR}/${OUTPUT_DIR_STLDBG} -Wl,--rpath=${LIBMT_DIR}/${OUTPUT_DIR_STLDBG}:${LIBUTF_DIR}/${OUTPUT_DIR_STLDBG}:${LIBSOCK_DIR}/${OUTPUT_DIR_STLDBG}:${LIBSTEM_DIR}/${OUTPUT_DIR_STLDBG}:${STLPORT_LIB_DIR} +dbg-shared: LDSEARCH += -L${LIBMT_DIR}/${OUTPUT_DIR_DBG} -L${LIBUTF_DIR}/${OUTPUT_DIR_DBG} -L${LIBSOCK_DIR}/${OUTPUT_DIR_DBG} -L${LIBSTEM_DIR}/${OUTPUT_DIR_DBG} -Wl,--rpath=${LIBMT_DIR}/${OUTPUT_DIR_DBG}:${LIBUTF_DIR}/${OUTPUT_DIR_DBG}:${LIBSOCK_DIR}/${OUTPUT_DIR_DBG}:${LIBSTEM_DIR}/${OUTPUT_DIR_DBG}:${STLPORT_LIB_DIR} +endif + release-shared : LDLIBS = -lxmt -lsockios -lstem -lboost_test_utf -ldl stldbg-shared : LDLIBS = -lxmtstlg -lsockiosstlg -lstemstlg -lboost_test_utfstlg -ldl dbg-shared : LDLIBS = -lxmtg -lsockiosg -lstemg -lboost_test_utfg -ldl dbg-shared: DEFS += -DDEBUG -LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR}:${CoMT_LIB_DIR} - PHONY += dl dl-dbg dl-stldbg dl: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-26 13:58:55
|
Revision: 1480 http://svn.sourceforge.net/complement/?rev=1480&view=rev Author: complement Date: 2007-01-26 05:58:54 -0800 (Fri, 26 Jan 2007) Log Message: ----------- complement snapshot, 2007-01-26 Added Paths: ----------- tags/complement-20070126/ Copied: tags/complement-20070126 (from rev 1479, trunk/complement) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-01-26 13:58:34
|
Revision: 1479 http://svn.sourceforge.net/complement/?rev=1479&view=rev Author: complement Date: 2007-01-26 05:58:32 -0800 (Fri, 26 Jan 2007) Log Message: ----------- clean Removed Paths: ------------- tags/complement-20070126/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |