Thread Pools

Name

Thread Pools -- 

Synopsis


#include <glib.h>


struct      GThreadPool;
GThreadPool* g_thread_pool_new              (GFunc thread_func,
                                             gint max_threads,
                                             gulong stack_size,
                                             gboolean bound,
                                             GThreadPriority priority,
                                             gboolean exclusive,
                                             gpointer user_data,
                                             GError **error);
void        g_thread_pool_push              (GThreadPool *pool,
                                             gpointer data,
                                             GError **error);
void        g_thread_pool_set_max_threads   (GThreadPool *pool,
                                             gint max_threads,
                                             GError **error);
gint        g_thread_pool_get_max_threads   (GThreadPool *pool);
guint       g_thread_pool_get_num_threads   (GThreadPool *pool);
guint       g_thread_pool_unprocessed       (GThreadPool *pool);
void        g_thread_pool_free              (GThreadPool *pool,
                                             gboolean immediate,
                                             gboolean wait);
void        g_thread_pool_set_max_unused_threads
                                            (gint max_threads);
gint        g_thread_pool_get_max_unused_threads
                                            (void);
guint       g_thread_pool_get_num_unused_threads
                                            (void);
void        g_thread_pool_stop_unused_threads
                                            (void);

Description

Details

struct GThreadPool

struct GThreadPool
{
  GFunc thread_func;
  gulong stack_size;
  gboolean bound;
  GThreadPriority priority;
  gboolean exclusive;
  gpointer user_data;
};


g_thread_pool_new ()

GThreadPool* g_thread_pool_new              (GFunc thread_func,
                                             gint max_threads,
                                             gulong stack_size,
                                             gboolean bound,
                                             GThreadPriority priority,
                                             gboolean exclusive,
                                             gpointer user_data,
                                             GError **error);

thread_func : 
max_threads : 
stack_size : 
bound : 
priority : 
exclusive : 
user_data : 
error : 
Returns : 


g_thread_pool_push ()

void        g_thread_pool_push              (GThreadPool *pool,
                                             gpointer data,
                                             GError **error);

pool : 
data : 
error : 


g_thread_pool_set_max_threads ()

void        g_thread_pool_set_max_threads   (GThreadPool *pool,
                                             gint max_threads,
                                             GError **error);

pool : 
max_threads : 
error : 


g_thread_pool_get_max_threads ()

gint        g_thread_pool_get_max_threads   (GThreadPool *pool);

pool : 
Returns : 


g_thread_pool_get_num_threads ()

guint       g_thread_pool_get_num_threads   (GThreadPool *pool);

pool : 
Returns : 


g_thread_pool_unprocessed ()

guint       g_thread_pool_unprocessed       (GThreadPool *pool);

pool : 
Returns : 


g_thread_pool_free ()

void        g_thread_pool_free              (GThreadPool *pool,
                                             gboolean immediate,
                                             gboolean wait);

pool : 
immediate : 
wait : 


g_thread_pool_set_max_unused_threads ()

void        g_thread_pool_set_max_unused_threads
                                            (gint max_threads);

max_threads : 


g_thread_pool_get_max_unused_threads ()

gint        g_thread_pool_get_max_unused_threads
                                            (void);

Returns : 


g_thread_pool_get_num_unused_threads ()

guint       g_thread_pool_get_num_unused_threads
                                            (void);

Returns : 


g_thread_pool_stop_unused_threads ()

void        g_thread_pool_stop_unused_threads
                                            (void);