From 21f0f09256917dd5dff8d3cf4680322f96c67b7f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 5 Oct 2012 20:37:54 +0400 Subject: * Use mlock to speed up classifiers by locking statfiles in the RAM. --- src/statfile.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/statfile.h') diff --git a/src/statfile.h b/src/statfile.h index edb58e5db..5f7e856e5 100644 --- a/src/statfile.h +++ b/src/statfile.h @@ -94,6 +94,7 @@ typedef struct statfile_pool_s { memory_pool_mutex_t *lock; /**< mutex */ struct event *invalidate_event; /**< event for pool invalidation */ struct timeval invalidate_tv; + gboolean mlock_ok; /**< whether it is possible to use mlock (2) to avoid statfiles unloading */ } statfile_pool_t; /* Forwarded declarations */ @@ -139,6 +140,12 @@ gint statfile_pool_close (statfile_pool_t *pool, stat_file_t *file, gboolean kee */ void statfile_pool_delete (statfile_pool_t *pool); +/** + * Try to lock all statfiles in memory + * @param pool statfile pool object + */ +void statfile_pool_lockall (statfile_pool_t *pool); + /** * Lock specified file for exclusive use (eg. learning) * @param pool statfile pool object -- cgit v1.2.3