From bed60cae19aeac3b0fc07275f8c8fa2a7ec93639 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 7 Sep 2007 14:33:45 +0200 Subject: [PATCH] Added basic threading parameters. --- lib/sorter/TODO | 2 +- lib/sorter/array.c | 4 ++++ lib/sorter/config.c | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/sorter/TODO b/lib/sorter/TODO index f4a802ca..67964992 100644 --- a/lib/sorter/TODO +++ b/lib/sorter/TODO @@ -7,7 +7,7 @@ Improvements: o Use radix-sort for internal sorting. o Parallelization of internal sorting. o Clean up data types and make sure they cannot overflow. (size_t vs. u64 vs. sh_off_t vs. uns) -o Switching between direct and normal I/O. +o Switching between direct and normal I/O. Should use normal I/O if the input is small enough. o Deal with too rough range estimates in radix splitting. o How does the speed of radix splitting decrease with increasing number of hash bits? Does it help to use more bits than we need, so that we sort less data in memory? diff --git a/lib/sorter/array.c b/lib/sorter/array.c index a6c217e8..e3cc07fb 100644 --- a/lib/sorter/array.c +++ b/lib/sorter/array.c @@ -57,6 +57,10 @@ asort_radix(struct asort_context *ctx, void *array, void *buffer, uns num_elts, } } +#ifdef CONFIG_UCW_THREADS + +#endif + void asort_run(struct asort_context *ctx) { diff --git a/lib/sorter/config.c b/lib/sorter/config.c index a4bfc67b..b701c53f 100644 --- a/lib/sorter/config.c +++ b/lib/sorter/config.c @@ -21,6 +21,8 @@ uns sorter_min_radix_bits; uns sorter_max_radix_bits; uns sorter_min_multiway_bits; uns sorter_max_multiway_bits; +uns sorter_threads; +uns sorter_thread_threshold; struct fb_params sorter_fb_params; static struct cf_section sorter_config = { @@ -35,6 +37,8 @@ static struct cf_section sorter_config = { CF_UNS("MaxRadixBits", &sorter_max_radix_bits), CF_UNS("MinMultiwayBits", &sorter_min_multiway_bits), CF_UNS("MaxMultiwayBits", &sorter_max_multiway_bits), + CF_UNS("NumThreads", &sorter_threads), + CF_UNS("ThreadThreshold", &sorter_thread_threshold), CF_END } }; -- 2.39.2