From: Karel G. <kg...@us...> - 2001-11-25 21:27:29
|
Update of /cvsroot/micomt/mico/orb In directory usw-pr-cvs1:/tmp/cvs-serv5725/orb Modified Files: mt_manager.cc orb.cc Log Message: - implemented disabling of connection checking with using `-ORBConnLimit 0', connection checking is disabled by default for thread-pool concurrency model Index: mt_manager.cc =================================================================== RCS file: /cvsroot/micomt/mico/orb/mt_manager.cc,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -r1.42 -r1.43 *** mt_manager.cc 2001/11/24 19:45:26 1.42 --- mt_manager.cc 2001/11/25 21:27:25 1.43 *************** *** 350,361 **** MICO::MTManager::thread_setup(unsigned int conn_limit, unsigned int req_limit) { ! if (!conn_limit) ! { ! cerr << "-ORBConnLimit: Connection Limit must be non-zero" << endl; ! exit (-1); } ! tm_init[1].max = conn_limit; ! tm_init[2].max = conn_limit; ! if (!req_limit) { --- 350,376 ---- MICO::MTManager::thread_setup(unsigned int conn_limit, unsigned int req_limit) { ! if (!MICO::MTManager::thread_pool()) { ! // thread-per-connection and thread-per-request concurrency models ! if (!conn_limit) ! { ! cerr << "-ORBConnLimit: Connection Limit must be non-zero" << endl; ! exit (-1); ! } ! tm_init[1].max = conn_limit; ! tm_init[2].max = conn_limit; } ! else { ! // thread-pool concurrency model ! if (conn_limit > 0) { ! tm_init[1].max = conn_limit; ! tm_init[2].max = conn_limit; ! } ! else { ! // connection checking disabled by -ORBConnLimit 0 ! // but we have to set max limit on reader thread pool ! // because this thread-pool is used by client side ! tm_init[2].max = 10; ! } ! } if (!req_limit) { Index: orb.cc =================================================================== RCS file: /cvsroot/micomt/mico/orb/orb.cc,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -r1.46 -r1.47 *** orb.cc 2001/11/24 19:45:26 1.46 --- orb.cc 2001/11/25 21:27:25 1.47 *************** *** 2641,2646 **** string rcfile = "~/.micorc"; string id = _id; ! ULong ConnLimit = 10; ! ULong RequestLimit = 10; bool memtrace = false; vector<string> InitRefs; --- 2641,2650 ---- string rcfile = "~/.micorc"; string id = _id; ! // Connection checking is disabled by default ! // for default thread-pool concurrency model ! // Other concurrency model have default connection limit ! // set to 10. ! ULong ConnLimit = 0; ! ULong RequestLimit = 4; // The most common servers have up to four CPUs bool memtrace = false; vector<string> InitRefs; *************** *** 2777,2788 **** --- 2781,2798 ---- __thread_per_connection = FALSE; __thread_per_request = FALSE; + if (ConnLimit != 0) + ConnLimit = 0; } else if (arg == "-ORBThreadPerConnection") { __thread_pool = FALSE; __thread_per_connection = TRUE; __thread_per_request = FALSE; + if (ConnLimit < 1) + ConnLimit = 10; } else if (arg == "-ORBThreadPerRequest") { __thread_pool = FALSE; __thread_per_connection = FALSE; __thread_per_request = TRUE; + if (ConnLimit < 1) + ConnLimit = 10; } } *************** *** 2838,2842 **** if (__thread_pool) { MICO::MTManager::concurrency_model(MICO::MTManager::_S_thread_pool); ! cerr << "Using thread-pool concurrency model." << endl; // this is a hack because MICO::SelectDispatcher::_isblocking // is private static and method block is not static --- 2848,2856 ---- if (__thread_pool) { MICO::MTManager::concurrency_model(MICO::MTManager::_S_thread_pool); ! if (MICO::Logger::IsLogged(MICO::Logger::Info)) { ! MICOMT::AutoDebugLock __lock; ! MICO::Logger::Stream(MICO::Logger::Info) ! << "Using thread-pool concurrency model." << endl; ! } // this is a hack because MICO::SelectDispatcher::_isblocking // is private static and method block is not static *************** *** 2847,2855 **** if (__thread_per_connection) { MICO::MTManager::concurrency_model(MICO::MTManager::_S_thread_per_connection); ! cerr << "Using thread-per-connection concurrency model." << endl; } if (__thread_per_request) { MICO::MTManager::concurrency_model(MICO::MTManager::_S_thread_per_request); ! cerr << "Using thread-per-request concurrency model." << endl; } MICO::MTManager::thread_setup (ConnLimit, RequestLimit); --- 2861,2877 ---- if (__thread_per_connection) { MICO::MTManager::concurrency_model(MICO::MTManager::_S_thread_per_connection); ! if (MICO::Logger::IsLogged(MICO::Logger::Info)) { ! MICOMT::AutoDebugLock __lock; ! MICO::Logger::Stream(MICO::Logger::Info) ! << "Using thread-per-connection concurrency model." << endl; ! } } if (__thread_per_request) { MICO::MTManager::concurrency_model(MICO::MTManager::_S_thread_per_request); ! if (MICO::Logger::IsLogged(MICO::Logger::Info)) { ! MICOMT::AutoDebugLock __lock; ! MICO::Logger::Stream(MICO::Logger::Info) ! << "Using thread-per-request concurrency model." << endl; ! } } MICO::MTManager::thread_setup (ConnLimit, RequestLimit); |