comparison CoreController.c @ 286:b02b34681414

VReo V2 -- saves checker and doer fn with the port, where triggered
author Sean Halle <seanhalle@yahoo.com>
date Wed, 10 Jul 2013 14:49:04 -0700
parents 1d7ea1b0f176
children
comparison
equal deleted inserted replaced
21:c0910093da93 22:1aa22955f879
119 } 119 }
120 pthread_mutex_unlock( &suspendLock ); 120 pthread_mutex_unlock( &suspendLock );
121 121
122 HOLISTIC__CoreCtrl_Setup; 122 HOLISTIC__CoreCtrl_Setup;
123 123
124 DEBUG__printf1(TRUE, "started coreCtrlr", thisCoresIdx ); 124 DEBUG__printf1(TRUE, "started coreCtrlr %d", thisCoresIdx );
125 125
126 //====================== The Core Controller ====================== 126 //====================== The Core Controller ======================
127 while(1) 127 while(1)
128 { //Assembly code switches the core between animating a VP and 128 { //Assembly code switches the core between animating a VP and
129 // animating this core controller. The switch is done by 129 // animating this core controller. The switch is done by
178 doBackoff_for_TooLongToGetLock( numTriesToGetLock, &seed1, &seed2 ); 178 doBackoff_for_TooLongToGetLock( numTriesToGetLock, &seed1, &seed2 );
179 if( numTriesToGetLock > MASTERLOCK_RETRIES_BEFORE_YIELD ) 179 if( numTriesToGetLock > MASTERLOCK_RETRIES_BEFORE_YIELD )
180 { numTriesToGetLock = 0; pthread_yield(); } 180 { numTriesToGetLock = 0; pthread_yield(); }
181 } //while( currVP == NULL ) 181 } //while( currVP == NULL )
182 MEAS__Capture_Post_Master_Lock_Point; 182 MEAS__Capture_Post_Master_Lock_Point;
183
184 //have master lock, perform master function, which manages request 183 //have master lock, perform master function, which manages request
185 // handling and assigning work to this core's slot 184 // handling and assigning work to this core's slot
186 foundWork = 185 foundWork =
187 186
188 masterFunction( animSlot ); 187 masterFunction( animSlot );
212 */ 211 */
213 void * 212 void *
214 terminateCoreCtlr(SlaveVP *currSlv) 213 terminateCoreCtlr(SlaveVP *currSlv)
215 { 214 {
216 //first, free shutdown Slv that jumped here, then end the pthread 215 //first, free shutdown Slv that jumped here, then end the pthread
217 PR_int__recycle_slaveVP( currSlv ); 216 // PR_int__free_slaveVP( currSlv );
218 pthread_exit( NULL ); 217 pthread_exit( NULL );
219 } 218 }
220 219
221 inline uint32_t 220 inline uint32_t
222 randomNumber() 221 randomNumber()