summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2012-10-05 21:14:57 -0700
committerJosh Blum2012-10-05 21:14:57 -0700
commit5b7a0489def5c41c6b1a1569d4dd259788097605 (patch)
treec942571534a1ea280f1f63e335b397e6da479610
parentef98a2b26fe4457df3bb2de96ea0177889fd220b (diff)
downloadsandhi-5b7a0489def5c41c6b1a1569d4dd259788097605.tar.gz
sandhi-5b7a0489def5c41c6b1a1569d4dd259788097605.tar.bz2
sandhi-5b7a0489def5c41c6b1a1569d4dd259788097605.zip
cleanup task conclusion logic
-rw-r--r--lib/block.cpp1
-rw-r--r--lib/block_handlers.cpp6
-rw-r--r--lib/block_task.cpp15
-rw-r--r--lib/gras_impl/block_actor.hpp2
4 files changed, 5 insertions, 19 deletions
diff --git a/lib/block.cpp b/lib/block.cpp
index 85500f3..fefec9f 100644
--- a/lib/block.cpp
+++ b/lib/block.cpp
@@ -45,7 +45,6 @@ Block::Block(const std::string &name):
//setup some state variables
(*this)->block->topology_init = false;
- (*this)->block->forecast_fail = false;
(*this)->block->block_ptr = this;
(*this)->block->block_state = BlockActor::BLOCK_STATE_INIT;
diff --git a/lib/block_handlers.cpp b/lib/block_handlers.cpp
index ad0d721..2c14643 100644
--- a/lib/block_handlers.cpp
+++ b/lib/block_handlers.cpp
@@ -38,10 +38,8 @@ void BlockActor::handle_top_active(
this->block_ptr->start();
}
this->block_state = BLOCK_STATE_LIVE;
- if (this->input_queues.all_ready() and this->output_queues.all_ready())
- {
- this->Push(SelfKickMessage(), Theron::Address());
- }
+
+ this->Push(SelfKickMessage(), Theron::Address());
this->Send(0, from); //ACK
}
diff --git a/lib/block_task.cpp b/lib/block_task.cpp
index a64b3d7..39b0327 100644
--- a/lib/block_task.cpp
+++ b/lib/block_task.cpp
@@ -167,12 +167,11 @@ void BlockActor::handle_task(void)
num_output_items = num_output_items/2; //backoff regime
if (num_output_items) goto forecast_again_you_jerk;
- this->forecast_fail = true;
- this->conclusion();
+ //handle the case of forecast failing
+ this->mark_done();
return;
}
}
- this->forecast_fail = false;
//------------------------------------------------------------------
//-- the work
@@ -239,17 +238,9 @@ void BlockActor::handle_task(void)
//------------------------------------------------------------------
//-- Message self based on post-work conditions
//------------------------------------------------------------------
- this->conclusion();
-}
-
-GRAS_FORCE_INLINE void BlockActor::conclusion(void)
-{
//missing at least one upstream provider?
//since nothing else is coming in, its safe to mark done
- if (this->any_inputs_done() or this->forecast_fail)
- {
- this->mark_done();
- }
+ if (this->any_inputs_done()) this->mark_done();
//still have IO ready? kick off another task
if (this->input_queues.all_ready() and this->output_queues.all_ready())
diff --git a/lib/gras_impl/block_actor.hpp b/lib/gras_impl/block_actor.hpp
index d85e366..f11c569 100644
--- a/lib/gras_impl/block_actor.hpp
+++ b/lib/gras_impl/block_actor.hpp
@@ -112,7 +112,6 @@ struct BlockActor : Apology::Worker
void handle_task(void);
void sort_tags(const size_t index);
void trim_tags(const size_t index);
- void conclusion(void);
GRAS_FORCE_INLINE bool any_inputs_done(void)
{
if (this->inputs_done.none()) return false;
@@ -197,7 +196,6 @@ struct BlockActor : Apology::Worker
//rate settings
bool enable_fixed_rate;
double relative_rate;
- bool forecast_fail;
bool forecast_enable;
bool topology_init;
};