From e6246001a48009dc818d746b752a5e075a4106da Mon Sep 17 00:00:00 2001 From: dengg Date: Fri, 2 Feb 2007 05:14:23 +0000 Subject: Fri Feb 2 04:29:24 UTC 2007 Gan Deng --- CIAO/ChangeLog | 7 ++++++- CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp | 11 ++++++++--- CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp | 14 ++++---------- CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h | 8 +++++--- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 9eb56f77c06..d0b11551f64 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -13,7 +13,6 @@ Fri Feb 2 04:29:24 UTC 2007 Gan Deng debug_level control so the thread priority could be printed out. - * Plan_Launcher/Plan_Launcher.cpp * Plan_Launcher/Plan_Launcher_Impl.cpp * Plan_Launcher/Plan_Launcher_Impl.h @@ -23,6 +22,12 @@ Fri Feb 2 04:29:24 UTC 2007 Gan Deng priority model. The set_current_priority() method will set the client thread priority if the priority model is CLIENT_PROPAGATED on the EM side. + + * Plan_Launcher/Plan_Launcher.cpp + + Added a command line argument "-z" to allow priority + to be specified on Plan_Launcher, and then propagated + to the Execution Manager. Sun Jan 7 18:44:12 UTC 2007 Johnny Willemsen diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp index 108dc855530..642e3f6b606 100644 --- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp @@ -27,6 +27,7 @@ namespace CIAO const char* repoman_name_ = "RepositoryManager"; const char* dap_ior_filename = 0; const char* dap_ior = 0; + CORBA::Short priority = 0; enum mode_type { pl_mode_start, @@ -58,6 +59,7 @@ namespace CIAO ACE_TEXT ("-o \n") ACE_TEXT ("-i \n") ACE_TEXT ("-r \n") + ACE_TEXT ("-z \n") ACE_TEXT ("-h : Show this usage information\n"), program)); } @@ -68,7 +70,7 @@ namespace CIAO { ACE_Get_Opt get_opt (argc, argv, - ACE_TEXT ("a:e:p:nk:l:v:t:o:i:r:h")); + ACE_TEXT ("a:e:p:nk:l:v:t:o:i:r:z:h")); int c; while ((c = get_opt ()) != EOF) @@ -117,6 +119,9 @@ namespace CIAO new_deployment_plan_url = get_opt.opt_arg (); mode = pl_mode_redeployment; break; + case 'z': + priority = ACE_OS::atoi (get_opt.opt_arg ()); + break; case 'h': default: usage(argv[0]); @@ -186,14 +191,14 @@ namespace CIAO if (parse_args (argc, argv) == false) return -1; -// Plan_Launcher_i launcher (orb.in ()); Plan_Launcher_i launcher; if (!launcher.init (em_use_naming ? 0 : em_ior_file, orb.in (), use_repoman, rm_use_naming, - rm_use_naming ? repoman_name_ : rm_ior_file)) + rm_use_naming ? repoman_name_ : rm_ior_file, + priority)) { ACE_ERROR ((LM_ERROR, "(%P|%t) Plan_Launcher: Error initializing the EM.\n")); return -1; diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp index 66e1078c031..95a072969ab 100644 --- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp @@ -46,22 +46,17 @@ namespace CIAO { } - Plan_Launcher_i::Plan_Launcher_i (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) - , em_ () - , pg_ () - { - } - bool Plan_Launcher_i::init (const char *em_ior, CORBA::ORB_ptr orb, bool use_repoman, bool rm_use_naming, - const char *rm_name + const char *rm_name, + CORBA::Short priority ACE_ENV_ARG_DECL) { this->orb_ = CORBA::ORB::_duplicate (orb); + this->desired_priority_ = priority; CORBA::Object_var obj; @@ -99,7 +94,7 @@ namespace CIAO { // Set the priority of the current thread, so it can be propagated // to the ExecutionManager - this->set_current_priority (2); + this->set_current_priority (this->desired_priority_); } if (use_repoman) @@ -493,7 +488,6 @@ namespace CIAO // native_priority), // false); - current->the_priority (desired_priority ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h index d8896607c90..7b30f6735ac 100644 --- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h @@ -39,13 +39,12 @@ namespace CIAO Plan_Launcher_i (); - Plan_Launcher_i (CORBA::ORB_ptr orb); - bool init (const char *em_ior, CORBA::ORB_ptr orb, bool use_repoman = false, bool rm_use_naming = false, - const char *rm_name = 0 + const char *rm_name = 0, + CORBA::Short priority = 0 ACE_ENV_ARG_DECL_WITH_DEFAULTS); /** @@ -114,6 +113,9 @@ namespace CIAO Execution_Manager::DAM_Map map_; CIAO::Plan_Generator::Plan_Generator_i pg_; + + /// Desired CORBA prioirty to be propagated to EM + CORBA::Short desired_priority_; }; } -- cgit v1.2.1