diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-08-19 14:13:19 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-08-19 14:13:19 +0000 |
commit | 9dd0824b40e7afeaf948a564d544b384db12cadf (patch) | |
tree | 4d98c8d27669e8eca6259a9601e32fddfa67e39c /src/testbed/testbed_api.c | |
parent | d4051630bbc5f521142f302baad60212b75f8b7f (diff) | |
download | gnunet-9dd0824b40e7afeaf948a564d544b384db12cadf.tar.gz gnunet-9dd0824b40e7afeaf948a564d544b384db12cadf.zip |
fix 2893: Move adaptive parallelisation mechanism to operation queues
Diffstat (limited to 'src/testbed/testbed_api.c')
-rw-r--r-- | src/testbed/testbed_api.c | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index 010d51776..48b7fe189 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c | |||
@@ -860,7 +860,7 @@ handle_op_fail_event (struct GNUNET_TESTBED_Controller *c, | |||
860 | struct OverlayConnectData *data; | 860 | struct OverlayConnectData *data; |
861 | 861 | ||
862 | data = opc->data; | 862 | data = opc->data; |
863 | data->failed = GNUNET_YES; | 863 | GNUNET_TESTBED_operation_mark_failed (opc->op); |
864 | if (NULL != data->cb) | 864 | if (NULL != data->cb) |
865 | data->cb (data->cb_cls, opc->op, emsg); | 865 | data->cb (data->cb_cls, opc->op, emsg); |
866 | } | 866 | } |
@@ -1486,13 +1486,15 @@ GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host, | |||
1486 | GNUNET_TESTBED_mark_host_registered_at_ (host, controller); | 1486 | GNUNET_TESTBED_mark_host_registered_at_ (host, controller); |
1487 | controller->host = host; | 1487 | controller->host = host; |
1488 | controller->opq_parallel_operations = | 1488 | controller->opq_parallel_operations = |
1489 | GNUNET_TESTBED_operation_queue_create_ ((unsigned int) | 1489 | GNUNET_TESTBED_operation_queue_create_ (OPERATION_QUEUE_TYPE_FIXED, |
1490 | max_parallel_operations); | 1490 | (unsigned int) max_parallel_operations); |
1491 | controller->opq_parallel_service_connections = | 1491 | controller->opq_parallel_service_connections = |
1492 | GNUNET_TESTBED_operation_queue_create_ ((unsigned int) | 1492 | GNUNET_TESTBED_operation_queue_create_ (OPERATION_QUEUE_TYPE_FIXED, |
1493 | (unsigned int) | ||
1493 | max_parallel_service_connections); | 1494 | max_parallel_service_connections); |
1494 | controller->opq_parallel_topology_config_operations = | 1495 | controller->opq_parallel_topology_config_operations = |
1495 | GNUNET_TESTBED_operation_queue_create_ ((unsigned int) | 1496 | GNUNET_TESTBED_operation_queue_create_ (OPERATION_QUEUE_TYPE_FIXED, |
1497 | (unsigned int) | ||
1496 | max_parallel_topology_config_operations); | 1498 | max_parallel_topology_config_operations); |
1497 | controller_hostname = GNUNET_TESTBED_host_get_hostname (host); | 1499 | controller_hostname = GNUNET_TESTBED_host_get_hostname (host); |
1498 | if (NULL == controller_hostname) | 1500 | if (NULL == controller_hostname) |
@@ -1856,13 +1858,25 @@ GNUNET_TESTBED_create_helper_init_msg_ (const char *trusted_ip, | |||
1856 | 1858 | ||
1857 | 1859 | ||
1858 | /** | 1860 | /** |
1859 | * Signal that the information from an operation has been fully | 1861 | * This function is used to signal that the event information (struct |
1860 | * processed. This function MUST be called for each event | 1862 | * GNUNET_TESTBED_EventInformation) from an operation has been fully processed |
1861 | * of type 'operation_finished' to fully remove the operation | 1863 | * i.e. if the event callback is ever called for this operation. If the event |
1862 | * from the operation queue. After calling this function, the | 1864 | * callback for this operation has not yet been called, calling this function |
1863 | * 'op_result' becomes invalid (!). | 1865 | * cancels the operation, frees its resources and ensures the no event is |
1866 | * generated with respect to this operation. Note that however cancelling an | ||
1867 | * operation does NOT guarantee that the operation will be fully undone (or that | ||
1868 | * nothing ever happened). | ||
1864 | * | 1869 | * |
1865 | * @param operation operation to signal completion for | 1870 | * This function MUST be called for every operation to fully remove the |
1871 | * operation from the operation queue. After calling this function, if | ||
1872 | * operation is completed and its event information is of type | ||
1873 | * GNUNET_TESTBED_ET_OPERATION_FINISHED, the 'op_result' becomes invalid (!). | ||
1874 | |||
1875 | * If the operation is generated from GNUNET_TESTBED_service_connect() then | ||
1876 | * calling this function on such as operation calls the disconnect adapter if | ||
1877 | * the connect adapter was ever called. | ||
1878 | * | ||
1879 | * @param operation operation to signal completion or cancellation | ||
1866 | */ | 1880 | */ |
1867 | void | 1881 | void |
1868 | GNUNET_TESTBED_operation_done (struct GNUNET_TESTBED_Operation *operation) | 1882 | GNUNET_TESTBED_operation_done (struct GNUNET_TESTBED_Operation *operation) |