[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: make parallelism configurable
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: make parallelism configurable |
Date: |
Sun, 22 Nov 2020 22:31:09 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new cbba3d5f make parallelism configurable
cbba3d5f is described below
commit cbba3d5f292517c72b6c20299d9c023ba7a4c344
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Nov 22 22:31:07 2020 +0100
make parallelism configurable
---
src/util/taler-helper-crypto-rsa.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/util/taler-helper-crypto-rsa.c
b/src/util/taler-helper-crypto-rsa.c
index abd8014f..b8f959ee 100644
--- a/src/util/taler-helper-crypto-rsa.c
+++ b/src/util/taler-helper-crypto-rsa.c
@@ -245,6 +245,13 @@ struct WorkItem
*/
static int global_ret;
+/**
+ * Number of worker threads to use. Default (0) is to use one per CPU core
+ * available.
+ * Length of the #workers array.
+ */
+static unsigned int num_workers;
+
/**
* Time when the key update is executed.
* Either the actual current time, or a pretended time.
@@ -386,11 +393,6 @@ static volatile bool in_shutdown;
*/
static pthread_t *workers;
-/**
- * Length of the #workers array.
- */
-static unsigned int num_workers;
-
/**
* Main function of a worker thread that signs.
@@ -1879,7 +1881,8 @@ run (void *cls,
NULL);
/* start crypto workers */
- num_workers = 1; // for now...
+ if (0 == num_workers)
+ num_workers = sysconf (_SC_NPROCESSORS_CONF);
workers = GNUNET_new_array (num_workers,
pthread_t);
for (unsigned int i = 0; i<num_workers; i++)
@@ -1905,6 +1908,11 @@ main (int argc,
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_option_timetravel ('T',
"timetravel"),
+ GNUNET_GETOPT_option_uint ('p',
+ "parallelism",
+ "NUM_WORKERS",
+ "number of worker threads to use",
+ &num_workers),
GNUNET_GETOPT_option_absolute_time ('t',
"time",
"TIMESTAMP",
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: make parallelism configurable,
gnunet <=