Browse Source

Enable configuring submission thread limit with --submit-threads option

Luke Dashjr 13 years ago
parent
commit
feb20e1a12
2 changed files with 7 additions and 2 deletions
  1. 1 0
      README
  2. 6 2
      cgminer.c

+ 1 - 0
README

@@ -154,6 +154,7 @@ Options for both config file and command line:
 --sharelog <arg>    Append share log to file
 --shares <arg>      Quit after mining N shares (default: unlimited)
 --socks-proxy <arg> Set socks4 proxy (host:port)
+--submit-threads    Maximum number of share submission threads (default: 64)
 --syslog            Use system log for output messages (default: standard error)
 --temp-cutoff <arg> Temperature where a device will be automatically disabled, one value or comma separated list (default: 95)
 --text-only|-T      Disable ncurses formatted screen output

+ 6 - 2
cgminer.c

@@ -128,6 +128,7 @@ bool use_curses;
 #endif
 static bool opt_submit_stale = true;
 static int opt_shares;
+static int opt_submit_threads = 0x40;
 static bool opt_fail_only;
 bool opt_autofan;
 bool opt_autoengine;
@@ -940,6 +941,9 @@ static struct opt_table opt_config_table[] = {
 	OPT_WITH_ARG("--socks-proxy",
 		     opt_set_charp, NULL, &opt_socks_proxy,
 		     "Set socks4 proxy (host:port)"),
+	OPT_WITHOUT_ARG("--submit-threads",
+	                opt_set_intval, &opt_submit_threads,
+	                "Maximum number of share submission threads (default: 64)"),
 #ifdef HAVE_SYSLOG_H
 	OPT_WITHOUT_ARG("--syslog",
 			opt_set_bool, &use_syslog,
@@ -3310,9 +3314,9 @@ static void *workio_thread(void *userdata)
 		case WC_SUBMIT_WORK:
 		{
 			mutex_lock(&submitting_lock);
-			if (submitting >= 0x40) {
+			if (submitting >= opt_submit_threads) {
 				if (list_empty(&submit_waiting))
-					applog(LOG_WARNING, "workio_thread queuing submissions");
+					applog(LOG_WARNING, "workio_thread queuing submissions (see --submit-threads)");
 				else
 					applog(LOG_DEBUG, "workio_thread queuing submission");
 				list_add_tail(&wc->list, &submit_waiting);