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_operations.h | |
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_operations.h')
-rw-r--r-- | src/testbed/testbed_api_operations.h | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/src/testbed/testbed_api_operations.h b/src/testbed/testbed_api_operations.h index b6885e69a..c44325307 100644 --- a/src/testbed/testbed_api_operations.h +++ b/src/testbed/testbed_api_operations.h | |||
@@ -38,14 +38,35 @@ struct OperationQueue; | |||
38 | 38 | ||
39 | 39 | ||
40 | /** | 40 | /** |
41 | * The type of operation queue | ||
42 | */ | ||
43 | enum OperationQueueType | ||
44 | { | ||
45 | /** | ||
46 | * Operation queue which permits a fixed maximum number of operations to be | ||
47 | * active at any time | ||
48 | */ | ||
49 | OPERATION_QUEUE_TYPE_FIXED, | ||
50 | |||
51 | /** | ||
52 | * Operation queue which adapts the number of operations to be active based on | ||
53 | * the operation completion times of previously executed operation in it | ||
54 | */ | ||
55 | OPERATION_QUEUE_TYPE_ADAPTIVE | ||
56 | }; | ||
57 | |||
58 | |||
59 | /** | ||
41 | * Create an operation queue. | 60 | * Create an operation queue. |
42 | * | 61 | * |
43 | * @param max_active maximum number of operations in this | 62 | * @param type the type of operation queue |
44 | * queue that can be active in parallel at the same time | 63 | * @param max_active maximum number of operations in this queue that can be |
64 | * active in parallel at the same time. | ||
45 | * @return handle to the queue | 65 | * @return handle to the queue |
46 | */ | 66 | */ |
47 | struct OperationQueue * | 67 | struct OperationQueue * |
48 | GNUNET_TESTBED_operation_queue_create_ (unsigned int max_active); | 68 | GNUNET_TESTBED_operation_queue_create_ (enum OperationQueueType type, |
69 | unsigned int max_active); | ||
49 | 70 | ||
50 | 71 | ||
51 | /** | 72 | /** |
@@ -199,5 +220,14 @@ void | |||
199 | GNUNET_TESTBED_operation_activate_ (struct GNUNET_TESTBED_Operation *op); | 220 | GNUNET_TESTBED_operation_activate_ (struct GNUNET_TESTBED_Operation *op); |
200 | 221 | ||
201 | 222 | ||
223 | /** | ||
224 | * Marks an operation as failed | ||
225 | * | ||
226 | * @param op the operation to be marked as failed | ||
227 | */ | ||
228 | void | ||
229 | GNUNET_TESTBED_operation_mark_failed (struct GNUNET_TESTBED_Operation *op); | ||
230 | |||
231 | |||
202 | #endif | 232 | #endif |
203 | /* end of testbed_api_operations.h */ | 233 | /* end of testbed_api_operations.h */ |