2 * sgen-workers.c: Worker threads for parallel and concurrent GC.
4 * Copyright 2011 Xamarin Inc (http://www.xamarin.com)
5 * Copyright (C) 2012 Xamarin Inc
7 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
10 #ifndef __MONO_SGEN_WORKER_H__
11 #define __MONO_SGEN_WORKER_H__
13 #include "mono/sgen/sgen-thread-pool.h"
15 typedef struct _WorkerData WorkerData
;
17 SgenGrayQueue private_gray_queue
; /* only read/written by worker thread */
20 void sgen_workers_init (int num_workers
);
21 void sgen_workers_stop_all_workers (void);
22 void sgen_workers_start_all_workers (SgenObjectOperations
*object_ops
, SgenThreadPoolJob
*finish_job
);
23 void sgen_workers_init_distribute_gray_queue (void);
24 void sgen_workers_enqueue_job (SgenThreadPoolJob
*job
, gboolean enqueue
);
25 void sgen_workers_wait_for_jobs_finished (void);
26 void sgen_workers_distribute_gray_queue_sections (void);
27 void sgen_workers_reset_data (void);
28 void sgen_workers_join (void);
29 gboolean
sgen_workers_have_idle_work (void);
30 gboolean
sgen_workers_all_done (void);
31 gboolean
sgen_workers_are_working (void);
32 void sgen_workers_assert_gray_queue_is_empty (void);
33 void sgen_workers_take_from_queue_and_awake (SgenGrayQueue
*queue
);