summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsergio <sergio@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-05-21 22:59:58 +0000
committersergio <sergio@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-05-21 22:59:58 +0000
commit39e47f3e5a7df6ec5c237718e9a4019600f2d8a0 (patch)
tree826a93555863c5d9fd4ef646be39663dae333c92
parent33d03db82ef99c033465bfd7ee96e850a5101ebd (diff)
downloadATCD-39e47f3e5a7df6ec5c237718e9a4019600f2d8a0.tar.gz
*** empty log message ***
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp60
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp65
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp47
-rw-r--r--TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp60
-rw-r--r--TAO/tests/Cubit/TAO/MT_Cubit/client.cpp65
-rw-r--r--TAO/tests/Cubit/TAO/MT_Cubit/server.cpp47
6 files changed, 226 insertions, 118 deletions
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
index 289727ec94b..3f2e98970f3 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
@@ -215,7 +215,7 @@ Client::get_high_priority_jitter (void)
// We first compute the sum of the squares of the differences
// each latency has from the average
- for (u_int i = 0; i < ts_->loop_count_ / ts_->granularity_; i ++)
+ for (u_int i = 0; i < number_of_samples; i ++)
{
double difference =
ts_->global_jitter_array_ [0][i] - average;
@@ -289,7 +289,9 @@ Client::svc (void)
// Add the argument.
ACE_OS::strcat (tmp_buf,
- " -ORBobjrefstyle url ");
+ " -ORBobjrefstyle url "
+ " -ORBrcvsock 32768 "
+ " -ORBsndsock 32768 ");
// Convert back to argv vector style.
ACE_ARGV tmp_args2 (tmp_buf);
@@ -424,7 +426,8 @@ Client::svc (void)
{
ACE_DEBUG ((LM_DEBUG,
" (%t) resolve() returned nil\n"));
- TAO_TRY_ENV.print_exception ("Attempt to resolve() a cubit object using the name service Failed!\n");
+ TAO_TRY_ENV.print_exception ("Attempt to resolve() a cubit object"
+ "using the name service Failed!\n");
}
else
{
@@ -590,7 +593,7 @@ Client::run_tests (Cubit_ptr cb,
double *my_jitter_array;
ACE_NEW_RETURN (my_jitter_array,
- double [loop_count],
+ double [loop_count*3], // magic number, for now.
-1);
double latency = 0;
@@ -607,13 +610,14 @@ Client::run_tests (Cubit_ptr cb,
quantify_stop_recording_data();
quantify_clear_data ();
#endif /* USE_QUANTIFY */
+
+ ACE_High_Res_Timer * timer_ = 0;
// Make the calls in a loop.
- ACE_High_Res_Timer * timer_ = 0;
// if i'm the high priority client, loop forever, until all low
// priority clients are done. This is implemented with a semaphore.
- for (i = 0; i < loop_count || id_ == 0; i++)
+ for (i = 0; i < loop_count || (id_ == 0 && ts_->thread_count_ > 1); i++)
{
// Elapsed time will be in microseconds.
ACE_Time_Value delta_t;
@@ -632,9 +636,9 @@ Client::run_tests (Cubit_ptr cb,
#if defined (CHORUS)
pstartTime = pccTime1Get();
#else /* CHORUS */
- ACE_NEW_RETURN (timer_,
- ACE_High_Res_Timer,
- -1);
+ ACE_NEW_RETURN (timer_,
+ ACE_High_Res_Timer,
+ -1);
timer_->start ();
#endif /* !CHORUS */
}
@@ -856,12 +860,29 @@ Client::run_tests (Cubit_ptr cb,
// update the latency array, correcting the index using the granularity
#else /* ACE_LACKS_FLOATING_POINT */
// Store the time in secs.
+
+// These comments are to temporarily fix what seems a bug in
+// the ACE_Long_Long class that is used to calc the elapsed
+// time, which appears only in VxWorks.
+// I'll leave these here to debug it later.
+// double tmp = (double)delta_t.sec ();
+// if (tmp > 100000) tmp=0.0;
+// real_time = tmp + (double)delta_t.usec () / (double)ACE_ONE_SECOND_IN_USECS;
+
real_time = (double)delta_t.sec () + (double)delta_t.usec () / (double)ACE_ONE_SECOND_IN_USECS;
+
+// if (real_time > 100000)
+// fprintf(stderr, "real_time=%f, delta_t.sec ()=%d, delta_t.usec ()=%d\n",
+// real_time,
+// delta_t.sec (),
+// delta_t.usec ());
+
real_time /= ts_->granularity_;
+
delta = ((0.4 * fabs (real_time * (1000 * 1000))) + (0.6 * delta)); // pow(10,6)
latency += (real_time * ts_->granularity_);
my_jitter_array [i/ts_->granularity_] = real_time * 1000;
- // delete timer_;
+ delete timer_;
#endif /* !ACE_LACKS_FLOATING_POINT */
}
@@ -869,16 +890,17 @@ Client::run_tests (Cubit_ptr cb,
// if tryacquire() succeeded then a client must have done a
// release () on it, thus we decrement the client counter.
if (id_ == 0 && ts_->thread_count_ > 1)
- if (ts_->semaphore_->tryacquire () != -1)
- {
- low_priority_client_count --;
- // if all clients are done then break out of loop.
- if (low_priority_client_count == 0)
- break;
- }
-
+ {
+ if (ts_->semaphore_->tryacquire () != -1)
+ {
+ low_priority_client_count --;
+ // if all clients are done then break out of loop.
+ if (low_priority_client_count <= 0)
+ break;
+ }
+ }
}
-
+
if (id_ == 0)
ts_->high_priority_loop_count_ = call_count;
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
index d05a3a76cd1..3c9c366dbd8 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
@@ -121,12 +121,8 @@ do_priority_inversion_test (ACE_Thread_Manager &thread_manager,
util_thread.close ();
}
- // Now activate the high priority client.
-#if defined (VXWORKS)
- priority = ACE_THR_PRI_FIFO_DEF + 50;
-#else /* ! VXWORKS */
- priority = ACE_THR_PRI_FIFO_DEF + 25;
-#endif /* ! VXWORKS */
+ // Now activate the high priority client with default real-time priority
+ priority = ACE_THR_PRI_FIFO_DEF;
ACE_DEBUG ((LM_DEBUG,
"Creating 1 client with high priority of %d\n",
@@ -150,18 +146,13 @@ do_priority_inversion_test (ACE_Thread_Manager &thread_manager,
ACE_SCOPE_THREAD),
ACE_SCOPE_THREAD);
- // Drop the priority, so that the priority of clients will increase
- // with increasing client number.
- for (j = 0; j < ts.thread_count_; j++)
- priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
+
+ priority = max_low_client_priority;
ACE_DEBUG ((LM_DEBUG,
- "Creating %d clients with low priority ranging from %d to %d\n",
+ "Creating %d clients with low priority %d\n",
ts.thread_count_ - 1,
- priority,
- max_low_client_priority));
+ priority));
for (i = ts.thread_count_ - 1; i > 0; i--)
{
@@ -176,8 +167,7 @@ do_priority_inversion_test (ACE_Thread_Manager &thread_manager,
#endif /* VXWORKS */
ACE_DEBUG ((LM_DEBUG,
- "Creating client with low priority %d and thread ID %d\n",
- priority,
+ "Creating client with thread ID %d\n",
i));
// The first thread starts at the lowest priority of all the low
@@ -190,11 +180,6 @@ do_priority_inversion_test (ACE_Thread_Manager &thread_manager,
"%p; priority is %d\n",
"activate failed",
priority));
-
- // Get the next higher priority.
- priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
}
// Wait for all the client threads to be initialized before going
@@ -258,6 +243,42 @@ do_priority_inversion_test (ACE_Thread_Manager &thread_manager,
high_priority_client.get_high_priority_jitter (),
low_priority_client[0]->get_low_priority_latency (),
low_priority_client[0]->get_low_priority_jitter ()));
+ // output the latency values to a file, tab separated, to import it
+ // to Excel to calculate jitter, in the mean time we come up with
+ // the sqrt() function.
+ FILE *latency_file_handle = 0;
+ char latency_file[BUFSIZ];
+ char buffer[BUFSIZ];
+
+ ACE_OS::sprintf (latency_file,
+ "cb__%d.txt",
+ ts.thread_count_);
+
+ ACE_OS::fprintf(stderr,
+ "--->Output file for latency data is \"%s\"\n",
+ latency_file);
+
+ latency_file_handle = ACE_OS::fopen (latency_file, "w");
+
+ // This loop visits each client. thread_count_ is the number of clients.
+ for (u_int j = 0; j < ts.thread_count_; j ++)
+ {
+ ACE_OS::sprintf(buffer,
+ "%s #%d",
+ j==0? "High Priority": "Low Priority",
+ j);
+ // this loop visits each request latency from a client
+ for (u_int i = 0; i < (j==0? ts.high_priority_loop_count_:ts.loop_count_)/ts.granularity_; i ++)
+ {
+ ACE_OS::sprintf(buffer+strlen(buffer),
+ "\t%f\n",
+ ts.global_jitter_array_[j][i]);
+ fputs (buffer, latency_file_handle);
+ buffer[0]=0;
+ }
+ }
+
+ ACE_OS::fclose (latency_file_handle);
#elif defined (CHORUS)
ACE_DEBUG ((LM_DEBUG,
"Test done.\n"
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp
index 5a94991a918..910beae0fd4 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp
@@ -661,19 +661,28 @@ start_servants (ACE_Barrier &start_barrier)
0), //task id 0.
-1);
-#if defined (VXWORKS)
- ACE_Sched_Priority priority = ACE_THR_PRI_FIFO_DEF + 50;
-#else
- ACE_Sched_Priority priority = ACE_THR_PRI_FIFO_DEF + 25;
-#endif /* VXWORKS */
+// #if defined (VXWORKS)
+// ACE_Sched_Priority priority = ACE_THR_PRI_FIFO_DEF + 50;
+// #else
+// ACE_Sched_Priority priority = ACE_THR_PRI_FIFO_DEF + 25;
+// #endif /* VXWORKS */
+
+// priority = ACE_Sched_Params::priority_max (ACE_SCHED_FIFO,
+// ACE_SCOPE_THREAD);
+
+ ACE_Sched_Priority priority = ACE_THR_PRI_FIFO_DEF;
+ ACE_DEBUG ((LM_DEBUG,
+ "Creating servant with high priority %d\n",
+ priority));
+
// Make the high priority task an active object.
if (high_priority_task->activate (THR_BOUND | ACE_SCHED_FIFO,
1,
0,
priority) == -1)
{
- ACE_ERROR ((LM_ERROR, "(%P|%t; %p\n",
+ ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n",
"high_priority_task->activate"));
}
@@ -684,16 +693,21 @@ start_servants (ACE_Barrier &start_barrier)
Cubit_Task *[num_of_objs],
-1);
- // Drop the priority, so that the priority of clients will increase
- // with increasing client number.
- for (i = 0; i < num_of_objs; i++)
- priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
+ const ACE_pri_t max_low_servant_priority =
+ ACE_Sched_Params::previous_priority (
+ ACE_SCHED_FIFO,
+ ACE_Sched_Params::previous_priority (
+ ACE_SCHED_FIFO,
+ priority,
+ ACE_SCOPE_THREAD),
+ ACE_SCOPE_THREAD);
+
+ priority = max_low_servant_priority;
ACE_DEBUG ((LM_DEBUG,
- "Creating %d servants with low priority\n",
- num_of_objs - 1));
+ "Creating %d servants with low priority %d\n",
+ num_of_objs - 1,
+ priority));
// Create the low priority servants.
@@ -724,9 +738,6 @@ start_servants (ACE_Barrier &start_barrier)
"low_priority_task[i]->activate"));
}
- priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
}
char *args;
@@ -750,7 +761,7 @@ start_servants (ACE_Barrier &start_barrier)
FILE *ior_f = 0;
if (ior_file != 0)
- ior_f = ACE_OS::fopen (ior_file, "w");
+ ior_f = ACE_OS::fopen (ior_file, "w+");
for (i = 0; i < num_of_objs; ++i)
{
diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
index 289727ec94b..3f2e98970f3 100644
--- a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
+++ b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
@@ -215,7 +215,7 @@ Client::get_high_priority_jitter (void)
// We first compute the sum of the squares of the differences
// each latency has from the average
- for (u_int i = 0; i < ts_->loop_count_ / ts_->granularity_; i ++)
+ for (u_int i = 0; i < number_of_samples; i ++)
{
double difference =
ts_->global_jitter_array_ [0][i] - average;
@@ -289,7 +289,9 @@ Client::svc (void)
// Add the argument.
ACE_OS::strcat (tmp_buf,
- " -ORBobjrefstyle url ");
+ " -ORBobjrefstyle url "
+ " -ORBrcvsock 32768 "
+ " -ORBsndsock 32768 ");
// Convert back to argv vector style.
ACE_ARGV tmp_args2 (tmp_buf);
@@ -424,7 +426,8 @@ Client::svc (void)
{
ACE_DEBUG ((LM_DEBUG,
" (%t) resolve() returned nil\n"));
- TAO_TRY_ENV.print_exception ("Attempt to resolve() a cubit object using the name service Failed!\n");
+ TAO_TRY_ENV.print_exception ("Attempt to resolve() a cubit object"
+ "using the name service Failed!\n");
}
else
{
@@ -590,7 +593,7 @@ Client::run_tests (Cubit_ptr cb,
double *my_jitter_array;
ACE_NEW_RETURN (my_jitter_array,
- double [loop_count],
+ double [loop_count*3], // magic number, for now.
-1);
double latency = 0;
@@ -607,13 +610,14 @@ Client::run_tests (Cubit_ptr cb,
quantify_stop_recording_data();
quantify_clear_data ();
#endif /* USE_QUANTIFY */
+
+ ACE_High_Res_Timer * timer_ = 0;
// Make the calls in a loop.
- ACE_High_Res_Timer * timer_ = 0;
// if i'm the high priority client, loop forever, until all low
// priority clients are done. This is implemented with a semaphore.
- for (i = 0; i < loop_count || id_ == 0; i++)
+ for (i = 0; i < loop_count || (id_ == 0 && ts_->thread_count_ > 1); i++)
{
// Elapsed time will be in microseconds.
ACE_Time_Value delta_t;
@@ -632,9 +636,9 @@ Client::run_tests (Cubit_ptr cb,
#if defined (CHORUS)
pstartTime = pccTime1Get();
#else /* CHORUS */
- ACE_NEW_RETURN (timer_,
- ACE_High_Res_Timer,
- -1);
+ ACE_NEW_RETURN (timer_,
+ ACE_High_Res_Timer,
+ -1);
timer_->start ();
#endif /* !CHORUS */
}
@@ -856,12 +860,29 @@ Client::run_tests (Cubit_ptr cb,
// update the latency array, correcting the index using the granularity
#else /* ACE_LACKS_FLOATING_POINT */
// Store the time in secs.
+
+// These comments are to temporarily fix what seems a bug in
+// the ACE_Long_Long class that is used to calc the elapsed
+// time, which appears only in VxWorks.
+// I'll leave these here to debug it later.
+// double tmp = (double)delta_t.sec ();
+// if (tmp > 100000) tmp=0.0;
+// real_time = tmp + (double)delta_t.usec () / (double)ACE_ONE_SECOND_IN_USECS;
+
real_time = (double)delta_t.sec () + (double)delta_t.usec () / (double)ACE_ONE_SECOND_IN_USECS;
+
+// if (real_time > 100000)
+// fprintf(stderr, "real_time=%f, delta_t.sec ()=%d, delta_t.usec ()=%d\n",
+// real_time,
+// delta_t.sec (),
+// delta_t.usec ());
+
real_time /= ts_->granularity_;
+
delta = ((0.4 * fabs (real_time * (1000 * 1000))) + (0.6 * delta)); // pow(10,6)
latency += (real_time * ts_->granularity_);
my_jitter_array [i/ts_->granularity_] = real_time * 1000;
- // delete timer_;
+ delete timer_;
#endif /* !ACE_LACKS_FLOATING_POINT */
}
@@ -869,16 +890,17 @@ Client::run_tests (Cubit_ptr cb,
// if tryacquire() succeeded then a client must have done a
// release () on it, thus we decrement the client counter.
if (id_ == 0 && ts_->thread_count_ > 1)
- if (ts_->semaphore_->tryacquire () != -1)
- {
- low_priority_client_count --;
- // if all clients are done then break out of loop.
- if (low_priority_client_count == 0)
- break;
- }
-
+ {
+ if (ts_->semaphore_->tryacquire () != -1)
+ {
+ low_priority_client_count --;
+ // if all clients are done then break out of loop.
+ if (low_priority_client_count <= 0)
+ break;
+ }
+ }
}
-
+
if (id_ == 0)
ts_->high_priority_loop_count_ = call_count;
diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp
index d05a3a76cd1..3c9c366dbd8 100644
--- a/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp
+++ b/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp
@@ -121,12 +121,8 @@ do_priority_inversion_test (ACE_Thread_Manager &thread_manager,
util_thread.close ();
}
- // Now activate the high priority client.
-#if defined (VXWORKS)
- priority = ACE_THR_PRI_FIFO_DEF + 50;
-#else /* ! VXWORKS */
- priority = ACE_THR_PRI_FIFO_DEF + 25;
-#endif /* ! VXWORKS */
+ // Now activate the high priority client with default real-time priority
+ priority = ACE_THR_PRI_FIFO_DEF;
ACE_DEBUG ((LM_DEBUG,
"Creating 1 client with high priority of %d\n",
@@ -150,18 +146,13 @@ do_priority_inversion_test (ACE_Thread_Manager &thread_manager,
ACE_SCOPE_THREAD),
ACE_SCOPE_THREAD);
- // Drop the priority, so that the priority of clients will increase
- // with increasing client number.
- for (j = 0; j < ts.thread_count_; j++)
- priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
+
+ priority = max_low_client_priority;
ACE_DEBUG ((LM_DEBUG,
- "Creating %d clients with low priority ranging from %d to %d\n",
+ "Creating %d clients with low priority %d\n",
ts.thread_count_ - 1,
- priority,
- max_low_client_priority));
+ priority));
for (i = ts.thread_count_ - 1; i > 0; i--)
{
@@ -176,8 +167,7 @@ do_priority_inversion_test (ACE_Thread_Manager &thread_manager,
#endif /* VXWORKS */
ACE_DEBUG ((LM_DEBUG,
- "Creating client with low priority %d and thread ID %d\n",
- priority,
+ "Creating client with thread ID %d\n",
i));
// The first thread starts at the lowest priority of all the low
@@ -190,11 +180,6 @@ do_priority_inversion_test (ACE_Thread_Manager &thread_manager,
"%p; priority is %d\n",
"activate failed",
priority));
-
- // Get the next higher priority.
- priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
}
// Wait for all the client threads to be initialized before going
@@ -258,6 +243,42 @@ do_priority_inversion_test (ACE_Thread_Manager &thread_manager,
high_priority_client.get_high_priority_jitter (),
low_priority_client[0]->get_low_priority_latency (),
low_priority_client[0]->get_low_priority_jitter ()));
+ // output the latency values to a file, tab separated, to import it
+ // to Excel to calculate jitter, in the mean time we come up with
+ // the sqrt() function.
+ FILE *latency_file_handle = 0;
+ char latency_file[BUFSIZ];
+ char buffer[BUFSIZ];
+
+ ACE_OS::sprintf (latency_file,
+ "cb__%d.txt",
+ ts.thread_count_);
+
+ ACE_OS::fprintf(stderr,
+ "--->Output file for latency data is \"%s\"\n",
+ latency_file);
+
+ latency_file_handle = ACE_OS::fopen (latency_file, "w");
+
+ // This loop visits each client. thread_count_ is the number of clients.
+ for (u_int j = 0; j < ts.thread_count_; j ++)
+ {
+ ACE_OS::sprintf(buffer,
+ "%s #%d",
+ j==0? "High Priority": "Low Priority",
+ j);
+ // this loop visits each request latency from a client
+ for (u_int i = 0; i < (j==0? ts.high_priority_loop_count_:ts.loop_count_)/ts.granularity_; i ++)
+ {
+ ACE_OS::sprintf(buffer+strlen(buffer),
+ "\t%f\n",
+ ts.global_jitter_array_[j][i]);
+ fputs (buffer, latency_file_handle);
+ buffer[0]=0;
+ }
+ }
+
+ ACE_OS::fclose (latency_file_handle);
#elif defined (CHORUS)
ACE_DEBUG ((LM_DEBUG,
"Test done.\n"
diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp
index 5a94991a918..910beae0fd4 100644
--- a/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp
+++ b/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp
@@ -661,19 +661,28 @@ start_servants (ACE_Barrier &start_barrier)
0), //task id 0.
-1);
-#if defined (VXWORKS)
- ACE_Sched_Priority priority = ACE_THR_PRI_FIFO_DEF + 50;
-#else
- ACE_Sched_Priority priority = ACE_THR_PRI_FIFO_DEF + 25;
-#endif /* VXWORKS */
+// #if defined (VXWORKS)
+// ACE_Sched_Priority priority = ACE_THR_PRI_FIFO_DEF + 50;
+// #else
+// ACE_Sched_Priority priority = ACE_THR_PRI_FIFO_DEF + 25;
+// #endif /* VXWORKS */
+
+// priority = ACE_Sched_Params::priority_max (ACE_SCHED_FIFO,
+// ACE_SCOPE_THREAD);
+
+ ACE_Sched_Priority priority = ACE_THR_PRI_FIFO_DEF;
+ ACE_DEBUG ((LM_DEBUG,
+ "Creating servant with high priority %d\n",
+ priority));
+
// Make the high priority task an active object.
if (high_priority_task->activate (THR_BOUND | ACE_SCHED_FIFO,
1,
0,
priority) == -1)
{
- ACE_ERROR ((LM_ERROR, "(%P|%t; %p\n",
+ ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n",
"high_priority_task->activate"));
}
@@ -684,16 +693,21 @@ start_servants (ACE_Barrier &start_barrier)
Cubit_Task *[num_of_objs],
-1);
- // Drop the priority, so that the priority of clients will increase
- // with increasing client number.
- for (i = 0; i < num_of_objs; i++)
- priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
+ const ACE_pri_t max_low_servant_priority =
+ ACE_Sched_Params::previous_priority (
+ ACE_SCHED_FIFO,
+ ACE_Sched_Params::previous_priority (
+ ACE_SCHED_FIFO,
+ priority,
+ ACE_SCOPE_THREAD),
+ ACE_SCOPE_THREAD);
+
+ priority = max_low_servant_priority;
ACE_DEBUG ((LM_DEBUG,
- "Creating %d servants with low priority\n",
- num_of_objs - 1));
+ "Creating %d servants with low priority %d\n",
+ num_of_objs - 1,
+ priority));
// Create the low priority servants.
@@ -724,9 +738,6 @@ start_servants (ACE_Barrier &start_barrier)
"low_priority_task[i]->activate"));
}
- priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
}
char *args;
@@ -750,7 +761,7 @@ start_servants (ACE_Barrier &start_barrier)
FILE *ior_f = 0;
if (ior_file != 0)
- ior_f = ACE_OS::fopen (ior_file, "w");
+ ior_f = ACE_OS::fopen (ior_file, "w+");
for (i = 0; i < num_of_objs; ++i)
{