diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-10-17 16:22:32 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-10-17 16:22:32 +0000 |
commit | 0fe140180c1b1b5c55f36652275f4168a5e2e85c (patch) | |
tree | df53c0962dd256b06798ac99f8e57567c9e746e4 /src | |
parent | 97c3b5776fc68a92c3ea1bf7bda8140594bd1792 (diff) | |
download | gnunet-0fe140180c1b1b5c55f36652275f4168a5e2e85c.tar.gz gnunet-0fe140180c1b1b5c55f36652275f4168a5e2e85c.zip |
new operation queue for limiting overlay connects
Diffstat (limited to 'src')
-rw-r--r-- | src/testbed/testbed.conf.in | 1 | ||||
-rw-r--r-- | src/testbed/testbed_api.c | 16 | ||||
-rw-r--r-- | src/testbed/testbed_api.h | 5 | ||||
-rw-r--r-- | src/testbed/testbed_api_peers.c | 2 |
4 files changed, 23 insertions, 1 deletions
diff --git a/src/testbed/testbed.conf.in b/src/testbed/testbed.conf.in index ccd9c4f79..418f11cd3 100644 --- a/src/testbed/testbed.conf.in +++ b/src/testbed/testbed.conf.in | |||
@@ -12,3 +12,4 @@ UNIX_MATCH_GID = YES | |||
12 | MAX_PARALLEL_OPERATIONS = 1000 | 12 | MAX_PARALLEL_OPERATIONS = 1000 |
13 | MAX_PARALLEL_SERVICE_CONNECTIONS = 1000 | 13 | MAX_PARALLEL_SERVICE_CONNECTIONS = 1000 |
14 | MAX_PARALLEL_TOPOLOGY_CONFIG_OPERATIONS = 5 | 14 | MAX_PARALLEL_TOPOLOGY_CONFIG_OPERATIONS = 5 |
15 | MAX_PARALLEL_OVERLAY_CONNECT_OPERATIONS = 30 | ||
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index 7f9aeff0f..e5722218a 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c | |||
@@ -1566,6 +1566,7 @@ GNUNET_TESTBED_controller_connect (const struct GNUNET_CONFIGURATION_Handle | |||
1566 | unsigned long long max_parallel_operations; | 1566 | unsigned long long max_parallel_operations; |
1567 | unsigned long long max_parallel_service_connections; | 1567 | unsigned long long max_parallel_service_connections; |
1568 | unsigned long long max_parallel_topology_config_operations; | 1568 | unsigned long long max_parallel_topology_config_operations; |
1569 | unsigned long long max_parallel_overlay_connect_operations; | ||
1569 | 1570 | ||
1570 | if (GNUNET_OK != | 1571 | if (GNUNET_OK != |
1571 | GNUNET_CONFIGURATION_get_value_number (cfg, "testbed", | 1572 | GNUNET_CONFIGURATION_get_value_number (cfg, "testbed", |
@@ -1591,6 +1592,14 @@ GNUNET_TESTBED_controller_connect (const struct GNUNET_CONFIGURATION_Handle | |||
1591 | GNUNET_break (0); | 1592 | GNUNET_break (0); |
1592 | return NULL; | 1593 | return NULL; |
1593 | } | 1594 | } |
1595 | if (GNUNET_OK != | ||
1596 | GNUNET_CONFIGURATION_get_value_number (cfg, "testbed", | ||
1597 | "MAX_PARALLEL_OVERLAY_CONNECT_OPERATIONS", | ||
1598 | &max_parallel_overlay_connect_operations)) | ||
1599 | { | ||
1600 | GNUNET_break (0); | ||
1601 | return NULL; | ||
1602 | } | ||
1594 | controller = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Controller)); | 1603 | controller = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Controller)); |
1595 | controller->cc = cc; | 1604 | controller->cc = cc; |
1596 | controller->cc_cls = cc_cls; | 1605 | controller->cc_cls = cc_cls; |
@@ -1628,7 +1637,10 @@ GNUNET_TESTBED_controller_connect (const struct GNUNET_CONFIGURATION_Handle | |||
1628 | max_parallel_service_connections); | 1637 | max_parallel_service_connections); |
1629 | controller->opq_parallel_topology_config_operations= | 1638 | controller->opq_parallel_topology_config_operations= |
1630 | GNUNET_TESTBED_operation_queue_create_ ((unsigned int) | 1639 | GNUNET_TESTBED_operation_queue_create_ ((unsigned int) |
1631 | max_parallel_service_connections); | 1640 | max_parallel_topology_config_operations); |
1641 | controller->opq_parallel_overlay_connect_operations= | ||
1642 | GNUNET_TESTBED_operation_queue_create_ ((unsigned int) | ||
1643 | max_parallel_overlay_connect_operations); | ||
1632 | controller_hostname = GNUNET_TESTBED_host_get_hostname_ (host); | 1644 | controller_hostname = GNUNET_TESTBED_host_get_hostname_ (host); |
1633 | if (NULL == controller_hostname) | 1645 | if (NULL == controller_hostname) |
1634 | controller_hostname = "127.0.0.1"; | 1646 | controller_hostname = "127.0.0.1"; |
@@ -1719,6 +1731,8 @@ GNUNET_TESTBED_controller_disconnect (struct GNUNET_TESTBED_Controller | |||
1719 | (controller->opq_parallel_service_connections); | 1731 | (controller->opq_parallel_service_connections); |
1720 | GNUNET_TESTBED_operation_queue_destroy_ | 1732 | GNUNET_TESTBED_operation_queue_destroy_ |
1721 | (controller->opq_parallel_topology_config_operations); | 1733 | (controller->opq_parallel_topology_config_operations); |
1734 | GNUNET_TESTBED_operation_queue_destroy_ | ||
1735 | (controller->opq_parallel_overlay_connect_operations); | ||
1722 | GNUNET_free (controller); | 1736 | GNUNET_free (controller); |
1723 | } | 1737 | } |
1724 | 1738 | ||
diff --git a/src/testbed/testbed_api.h b/src/testbed/testbed_api.h index 001f40285..7b92ff51b 100644 --- a/src/testbed/testbed_api.h +++ b/src/testbed/testbed_api.h | |||
@@ -302,6 +302,11 @@ struct GNUNET_TESTBED_Controller | |||
302 | struct OperationQueue *opq_parallel_topology_config_operations; | 302 | struct OperationQueue *opq_parallel_topology_config_operations; |
303 | 303 | ||
304 | /** | 304 | /** |
305 | * Operation queue for simultaneous overlay connect operations | ||
306 | */ | ||
307 | struct OperationQueue *opq_parallel_overlay_connect_operations; | ||
308 | |||
309 | /** | ||
305 | * The operation id counter. use current value and increment | 310 | * The operation id counter. use current value and increment |
306 | */ | 311 | */ |
307 | uint32_t operation_counter; | 312 | uint32_t operation_counter; |
diff --git a/src/testbed/testbed_api_peers.c b/src/testbed/testbed_api_peers.c index 4902fc0f8..3c3f478ea 100644 --- a/src/testbed/testbed_api_peers.c +++ b/src/testbed/testbed_api_peers.c | |||
@@ -722,6 +722,8 @@ GNUNET_TESTBED_overlay_connect (void *op_cls, | |||
722 | &oprelease_overlay_connect); | 722 | &oprelease_overlay_connect); |
723 | GNUNET_TESTBED_operation_queue_insert_ (opc->c->opq_parallel_operations, | 723 | GNUNET_TESTBED_operation_queue_insert_ (opc->c->opq_parallel_operations, |
724 | opc->op); | 724 | opc->op); |
725 | GNUNET_TESTBED_operation_queue_insert_ | ||
726 | (opc->c->opq_parallel_overlay_connect_operations, opc->op); | ||
725 | return opc->op; | 727 | return opc->op; |
726 | } | 728 | } |
727 | 729 | ||