comparison AnimationMaster.c @ 278:2fc69e6c14ea

Dev_ML -- works in both sequential and concurrent modes
author Sean Halle <seanhalle@yahoo.com>
date Fri, 08 Mar 2013 05:34:21 -0800
parents 1d7ea1b0f176
children 72ffdb11ad8e 15ee3fe10e3d
comparison
equal deleted inserted replaced
19:0c3f409ca132 20:7d1faa0b41f5
72 //NOTE: left over from when had a coreController & MasterVP managed 72 //NOTE: left over from when had a coreController & MasterVP managed
73 // several slots 73 // several slots
74 if( slot->workIsDone ) 74 if( slot->workIsDone )
75 { slot->workIsDone = FALSE; 75 { slot->workIsDone = FALSE;
76 slot->needsWorkAssigned = TRUE; 76 slot->needsWorkAssigned = TRUE;
77 printf("top handle request: %d | reqType: %d\n", slot->coreSlotIsOn, (int32)req->reqType );fflush(stdin);
77 78
78 //An Idle VP has no request to handle, so skip to assign.. 79 //An Idle VP has no request to handle, so skip to assign..
79 if( slot->slaveAssignedToSlot->typeOfVP != IdleVP ) 80 if( slot->slaveAssignedToSlot->typeOfVP != IdleVP &&
81 slot->slaveAssignedToSlot->typeOfVP != ShutdownVP)
80 { 82 {
81 HOLISTIC__Record_AppResponder_start; //TODO: update to check which process for each slot 83 HOLISTIC__Record_AppResponder_start; //TODO: update to check which process for each slot
82 MEAS__startReqHdlr; 84 MEAS__startReqHdlr;
83 85
84 86
91 if( slave->typeOfVP == SlotTaskSlv && req->reqType != TaskEnd ) 93 if( slave->typeOfVP == SlotTaskSlv && req->reqType != TaskEnd )
92 PR_int__replace_with_new_slot_slv( slave ); 94 PR_int__replace_with_new_slot_slv( slave );
93 95
94 //Handle task create and end first -- they're special cases.. 96 //Handle task create and end first -- they're special cases..
95 switch( req->reqType ) 97 switch( req->reqType )
96 { case TaskEnd: 98 {
99 case TaskEnd:
97 { //do PR handler, which calls lang's hdlr and does recycle of 100 { //do PR handler, which calls lang's hdlr and does recycle of
98 // free task slave if needed -- PR handler checks for free task Slv 101 // free task slave if needed -- PR handler checks for free task Slv
99 PRHandle__EndTask( req, slave ); break; 102 PRHandle__EndTask( req, slave ); break;
100 } 103 }
101 case TaskCreate: 104 case TaskCreate:
119 } 122 }
120 123
121 MEAS__endReqHdlr; 124 MEAS__endReqHdlr;
122 HOLISTIC__Record_AppResponder_end; 125 HOLISTIC__Record_AppResponder_end;
123 }//if not idleVP 126 }//if not idleVP
127 else if( slot->slaveAssignedToSlot->typeOfVP == ShutdownVP )
128 { //ShutdownVP used, essentially, as a flag, to cause terminate here
129 PR_int__release_master_lock();
130 terminateCoreCtlr( slot->slaveAssignedToSlot );
131 }
124 } //if have request to be handled 132 } //if have request to be handled
125 133
126 //NOTE: IF statement is leftover from when master managed many slots 134 //NOTE: IF statement is leftover from when master managed many slots
127 didAssignWork = FALSE; 135 didAssignWork = FALSE;
128 if( slot->needsWorkAssigned ) //can probably remove IF, now that only one slot 136 if( slot->needsWorkAssigned ) //can probably remove IF, now that only one slot