Esempio n. 1
0
void ex_tcb::registerResizeSubtasks()
{
  // Register two resize tasks with the scheduler, one for the
  // down queue and one for the up queue. Do this only if there
  // is potential for resizing (if the initial size is less
  // than the max size for the queue). Set the resize limit.

  ExScheduler *sched      = globals_->getScheduler();
  Lng32        resizeLimit = (Lng32) getTdb()->getQueueResizeLimit();
  ex_queue    *whichQueue;

  whichQueue = getParentQueue().up;
  if (whichQueue->getSize() < getTdb()->getMaxQueueSizeUp())
    {
      whichQueue->setResizeLimit(resizeLimit);
      sched->registerResizeSubtask(ex_tcb::sResize,this,whichQueue,"RS");
    }

  whichQueue = getParentQueue().down;
  if (whichQueue->getSize() < getTdb()->getMaxQueueSizeDown())
    {
      whichQueue->setResizeLimit(resizeLimit);
      sched->registerResizeSubtask(ex_tcb::sResize,this,whichQueue,"RS");
    }
}
void ExSequenceTcb::registerSubtasks()
{
    ExScheduler *sched = getGlobals()->getScheduler();
    ex_tcb :: registerSubtasks();
    // Regsiter the I/O event, if overflow is possible
    if ( isUnboundedFollowing() ) {
      ioEventHandler_ = sched->registerNonQueueSubtask(sWork,this); 
      // work around: The handler was just created, while clusterDb was created
      // earlier (in the TCB ctor), so update clusterDb now with the handler
      ex_assert( clusterDb_ , "Unlimited following and no clusterDb_") ;
      clusterDb_->ioEventHandler_ = ioEventHandler_ ;
    }
};
Esempio n. 3
0
void ex_tcb::registerSubtasks()
{
  // the default implementation registers the default static
  // work procedure for all events that can occur for this task
  ExScheduler *sched = globals_->getScheduler();
  ex_queue_pair pQueue = getParentQueue();

  // register events for parent queue
  ex_assert(pQueue.down && pQueue.up,"Parent down queue must exist");
  sched->registerInsertSubtask(ex_tcb::sWork,   this, pQueue.down,"WK");
  sched->registerCancelSubtask(ex_tcb::sCancel, this, pQueue.down,"CN");
  sched->registerUnblockSubtask(ex_tcb::sWork,  this, pQueue.up,"WK");
  // BertBert VV
  // subtask to handle GET_NEXT_N events downstream.
  sched->registerNextSubtask(ex_tcb::sWork, this, pQueue.down,"GN");
  // BertBert ^^

  // register events for child queues
  Int32 nc = numChildren();
  for (Int32 i = 0; i < nc; i++)
    {
      const ex_tcb * childTcb = getChild(i);

      if (childTcb)
        {
          ex_queue_pair cQueue = childTcb->getParentQueue();

          sched->registerUnblockSubtask(ex_tcb::sWork,this, cQueue.down);
          sched->registerInsertSubtask(ex_tcb::sWork, this, cQueue.up);
        }
    }

  if (getPool())
    getPool()->setStaticMode(FALSE);
}
void ExProbeCacheTcb::registerSubtasks()
{
  ExScheduler *sched = getGlobals()->getScheduler();

  sched->registerInsertSubtask(sWorkDown,   this, qparent_.down,"PD");
  sched->registerUnblockSubtask(sWorkDown,  this, qchild_.down, "PD");

  sched->registerInsertSubtask(sWorkUp,     this, qchild_.up,   "PU");
  sched->registerUnblockSubtask(sWorkUp,    this, qparent_.up,  "PU");

  sched->registerCancelSubtask(sCancel,     this, qparent_.down,"CN");

  // We need to schedule workUp from workDown if a call to workDown 
  // has changed any request to either CACHE_HIT or CANCELED_NOT_STARTED 
  // and if it has not changed any request to CACHE_MISS.
  workUpTask_ = sched->registerNonQueueSubtask(sWorkUp, this, "PU");

}
////////////////////////////////////////////////////////////////////////
// Register subtasks 
//
void ExFirstNTcb::registerSubtasks()
{
  ExScheduler *sched = getGlobals()->getScheduler();
  ex_queue_pair pQueue = getParentQueue();

  // register events for parent queue
  ex_assert(pQueue.down && pQueue.up,"Parent down queue must exist");
  sched->registerInsertSubtask(ex_tcb::sWork, this, pQueue.down);
  sched->registerCancelSubtask(sCancel, this, pQueue.down);
  sched->registerUnblockSubtask(ex_tcb::sWork,this, pQueue.up);

  // register events for child queues
  const ex_queue_pair cQueue = getChild(0)->getParentQueue();

  sched->registerUnblockSubtask(ex_tcb::sWork,this, cQueue.down);
  sched->registerInsertSubtask(ex_tcb::sWork, this, cQueue.up);

}
Esempio n. 6
0
void ExVPJoinTcb::registerSubtasks()
{
  ExScheduler *sched = getGlobals()->getScheduler();

  // parent and child down queues are handled by workDown()
  sched->registerInsertSubtask(sWorkDown, this, qParent_.down, "Work Down");
  sched->registerCancelSubtask(sWorkCancel, this, qParent_.down, "Work Cancel");
  Int32 i;
  for (i=0; i<numChildren_; i++)
    {
      sched->registerUnblockSubtask(sWorkDown, this, qChild_[i].down);
    }

  // parent and child up queues are handled by workUp()
  sched->registerUnblockSubtask(sWorkUp, this, qParent_.up, "Work Up");
  for (i=0; i<numChildren_; i++)
    {
      sched->registerInsertSubtask(sWorkUp, this, qChild_[i].up, "Work Up");
    }

  // make an event through which we can tell the scheduler to call
  // workUp().
  exceptionEvent_ = sched->registerNonQueueSubtask(sWorkUp, this);
}
Esempio n. 7
0
// ExTransposeTcb::registerSubtasks() -------------------------------------
// Register all the transpose subtasks with the scheduler.
//
void ExTransposeTcb::registerSubtasks()
{
  ExScheduler *sched = getGlobals()->getScheduler();
  
  // down queues are handled by workDown()
  //

  // Schedule this routine if a new entry is inserted into the
  // parents down queue and we are waiting on an event.
  // (had returned WORK_OK).
  //
  sched->registerInsertSubtask(sWorkDown, this, qParent_.down, "DN");

  // Schedule this routine if the child's down queue changes from being
  // full to being not full and we are waiting on an event.
  // (had returned WORK_OK).
  //
  sched->registerUnblockSubtask(sWorkDown, this, childQueue_.down, "DN");
  
  // Schedule this routine if a cancel request occurs on the 
  // parents down queue.
  //
  sched->registerCancelSubtask(sCancel, this, qParent_.down, "CN");
  
  // up queues are handled by workUp()
  //

  // Schedule this routine if the parent's up queue changes from being
  // full to being not full and we are waiting on an event.
  // (had returned WORK_OK).
  //
  sched->registerUnblockSubtask(sWorkUp, this, qParent_.up,"UP");

  // Schedule this routine if a new entry is inserted into the
  // child's up queue and we are waiting on an event.
  // (had returned WORK_OK).
  //
  sched->registerInsertSubtask(sWorkUp, this, childQueue_.up);
}