Commit 01eb4c599d5ab325a4ef1437609c46207cf156d2

Con Kolivas 2011-07-18T11:36:54

Minimise impact on GUIs by dropping priority and policy in gpu mining threads if dynamic mode is enabled.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/main.c b/main.c
index f83c7c7..08dc54a 100644
--- a/main.c
+++ b/main.c
@@ -1654,6 +1654,12 @@ static void *gpuminer_thread(void *userdata)
 	unsigned const long request_nonce = MAXTHREADS / 3 * 2;
 	bool requested = true;
 
+	if (opt_dynamic) {
+		/* Minimise impact on desktop if we want dynamic mode */
+		setpriority(PRIO_PROCESS, 0, 19);
+		drop_policy();
+	}
+
 	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
 
 	res = calloc(BUFFERSIZE, 1);