On Thursday 10 January 2008 03:12:29 Sebastien Dugue wrote:
> Here are some misc cleanups for async_handler:
>
> - Fix the default number of iterations in async_handler so that
> the run duration is really ~1 minute @ 2GHz according to the comment.
> On my test box @ 2GHz, it's more like 0.25s for 5000 iterations.
>
> - swap signal_thread() and handler_thread() function names to
> better reflect what the functions do.
>
> - remove the call to join_thread(signal_id) as join_threads()
> does the job.
>
> Signed-off-by: Sebastien Dugue <[EMAIL PROTECTED]>
Acked-by: Darren Hart <[EMAIL PROTECTED]>
> Cc: Darren Hart <[EMAIL PROTECTED]>
> Cc: Tim Chavez <[EMAIL PROTECTED]>
> ---
> .../realtime/func/async_handler/async_handler.c | 8 +++-----
> .../func/async_handler/async_handler_tsc.c | 13
> ++++--------- 2 files changed, 7 insertions(+), 14 deletions(-)
>
> diff --git a/testcases/realtime/func/async_handler/async_handler.c
> b/testcases/realtime/func/async_handler/async_handler.c index
> 7a73116..2dbd03c 100644
> --- a/testcases/realtime/func/async_handler/async_handler.c
> +++ b/testcases/realtime/func/async_handler/async_handler.c
> @@ -49,7 +49,7 @@
>
> #define SIGNAL_PRIO 89
> #define HANDLER_PRIO 89
> -#define DEFAULT_ITERATIONS 5000 /* about 1 minute @ 2GHz */
> +#define DEFAULT_ITERATIONS 1000000 /* about 1 minute @ 2GHz */
> #define HIST_BUCKETS 100
> #define PASS_US 100
>
> @@ -98,9 +98,8 @@ int parse_args(int c, char *v)
> return handled;
> }
>
> -void *signal_thread(void *arg)
> +void *handler_thread(void *arg)
> {
> -// struct thread *t = (struct thread *)arg;
>
> while (atomic_get(&step) != CHILD_QUIT) {
> pthread_mutex_lock(&mutex);
> @@ -119,7 +118,7 @@ void *signal_thread(void *arg)
> return 0;
> }
>
> -void *handler_thread(void *arg)
> +void *signal_thread(void *arg)
> {
>
> int i;
> @@ -203,7 +202,6 @@ int main(int argc, char *argv[])
> handler_id = create_fifo_thread(handler_thread, (void*)0,
> HANDLER_PRIO); signal_id = create_fifo_thread(signal_thread,
> (void*)0, SIGNAL_PRIO);
>
> - join_thread(signal_id);
> join_threads();
>
> printf("\nCriteria: latencies < %d\n", PASS_US);
> diff --git
> a/testcases/realtime/func/async_handler/async_handler_tsc.c
> b/testcases/realtime/func/async_handler/async_handler_tsc.c index
> 6131a8b..5245158 100644
> --- a/testcases/realtime/func/async_handler/async_handler_tsc.c
> +++ b/testcases/realtime/func/async_handler/async_handler_tsc.c
> @@ -47,8 +47,8 @@
> #include <libjvmsim.h>
> #include <libstats.h>
>
> -#define SIGNAL_PRIO 98
> -#define HANDLER_PRIO 99
> +#define HANDLER_PRIO 98
> +#define SIGNAL_PRIO 99
> #define ITERATIONS 10000000
> #define HIST_BUCKETS 100
> #define PASS_US 100
> @@ -147,10 +147,8 @@ unsigned long long tsc_period_ps(void)
> return (1000*(ns_end - ns_start)) / tsc_minus(tsc_start, tsc_end);
> }
>
> -void *signal_thread(void *arg)
> +void *handler_thread(void *arg)
> {
> -// struct thread *t = (struct thread *)arg;
> -
> while (atomic_get(&step) != CHILD_QUIT) {
> pthread_mutex_lock(&mutex);
> atomic_set(CHILD_WAIT, &step);
> @@ -168,10 +166,8 @@ void *signal_thread(void *arg)
> return NULL;
> }
>
> -void *handler_thread(void *arg)
> +void *signal_thread(void *arg)
> {
> -// struct thread *t = (struct thread *)arg;
> -
> int i;
> long delta, max, min;
> stats_container_t dat;
> @@ -259,7 +255,6 @@ int main(int argc, char *argv[])
> handler_id = create_fifo_thread(handler_thread, (void*)0,
> HANDLER_PRIO); signal_id = create_fifo_thread(signal_thread,
> (void*)0, SIGNAL_PRIO);
>
> - join_thread(signal_id);
> join_threads();
>
> printf("%d samples over 20 us latency\n", over_20);
--
Darren Hart
IBM Linux Technology Center
Real-Time Linux Team
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list