summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-threads/src/io-threads.h
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-01 13:59:43 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-02 19:19:18 +0530
commitb64fa35870b54b8d9e62afd71c92e35b1f7a4cfd (patch)
tree813474ecff343fb2cb9dca2fa11890aee32507be /xlators/performance/io-threads/src/io-threads.h
parentee79908d3b577c061b497e35481b8d1523502077 (diff)
io-threads: Add ordered threadpool state and code
Now we have the remaining fops going through the ordered thread-pool. To route a request through ordered thread, we use iot_schedule_ordered(..) and the worker thread for ordered requests is iot_worker_ordered(..) Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/performance/io-threads/src/io-threads.h')
-rw-r--r--xlators/performance/io-threads/src/io-threads.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.h b/xlators/performance/io-threads/src/io-threads.h
index f02b641f4..412b3cc76 100644
--- a/xlators/performance/io-threads/src/io-threads.h
+++ b/xlators/performance/io-threads/src/io-threads.h
@@ -83,6 +83,26 @@ struct iot_conf {
int32_t thread_count;
struct iot_worker ** workers;
+ xlator_t *this;
+ /* Config state for ordered threads. */
+ pthread_mutex_t otlock; /* Used to sync any state that needs to be
+ changed by the ordered threads.
+ */
+
+ int max_o_threads; /* Max. number of ordered threads */
+ int min_o_threads; /* Min. number of ordered threads. Ordered
+ thread count never falls below this
+ threshold.
+ */
+
+ int o_idle_time; /* in Secs. The idle time after which an
+ ordered thread exits.
+ */
+
+ struct iot_worker **oworkers; /* Ordered thread pool. */
+
+
+ /* Config state for unordered threads */
pthread_mutex_t utlock; /* Used for scaling un-ordered threads. */
struct iot_worker **uworkers; /* Un-ordered thread pool. */
int max_u_threads; /* Number of unordered threads will not be