diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-07-11 08:57:02 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-07-11 19:04:38 +0000 |
commit | daab757f5e52ce36a47e2d713365d68367a0e6dd (patch) | |
tree | cd3ae71f0e2f674b65374d414475ae62ac48cc69 /cmogstored.h | |
parent | 9302d584dcf68489a9c4739a3a42a468323ccda6 (diff) | |
download | cmogstored-daab757f5e52ce36a47e2d713365d68367a0e6dd.tar.gz |
This will allow us to detect I/O contention on our queue and yield the current thread to other clients for fairness. This can prevent a client from hogging the thread in situations where the network is much faster than the filesystem/disk.
Diffstat (limited to 'cmogstored.h')
-rw-r--r-- | cmogstored.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cmogstored.h b/cmogstored.h index f7fa022..4162931 100644 --- a/cmogstored.h +++ b/cmogstored.h @@ -101,6 +101,7 @@ struct mog_ioq { size_t max; pthread_mutex_t mtx; SIMPLEQ_HEAD(ioq_head, mog_fd) ioq_head; + bool contended; struct mog_svc *svc; }; @@ -635,6 +636,7 @@ void mog_yield(void); extern __thread struct mog_ioq *mog_ioq_current; void mog_ioq_init(struct mog_ioq *, struct mog_svc *, size_t val); bool mog_ioq_ready(struct mog_ioq *, struct mog_fd *) MOG_CHECK; +bool mog_ioq_contended(void) MOG_CHECK; void mog_ioq_next(struct mog_ioq *); void mog_ioq_destroy(struct mog_ioq *); bool mog_ioq_unblock(struct mog_fd *); |