comparison VMS.c @ 137:99343ffe1918

The shutdown now uses inter master requests
author Merten Sach <msach@mailbox.tu-berlin.de>
date Mon, 19 Sep 2011 14:15:37 +0200
parents f1374d5dbb98
children 99798e4438a6 8cc3d3812c8a
comparison
equal deleted inserted replaced
61:e53c6cc9aa58 62:f80eb0d6cd95
617 // been alloc'd with VMS__malloc, or freed by the level above animPr. 617 // been alloc'd with VMS__malloc, or freed by the level above animPr.
618 //So, all that's left to free here is the stack and the VirtProcr struc 618 //So, all that's left to free here is the stack and the VirtProcr struc
619 // itself 619 // itself
620 //Note, should not stack-allocate initial data -- no guarantee, in 620 //Note, should not stack-allocate initial data -- no guarantee, in
621 // general that creating processor will outlive ones it creates. 621 // general that creating processor will outlive ones it creates.
622 622
623 623 VMS__free( animatingPr->startOfStack);
624 /* 624 VMS__free( animatingPr);
625 * call the core specific version, because the creating master can already be dead
626 */
627 //VMS__free_in_lib( animatingPr->startOfStack, animatingPr );
628 //VMS__free_in_lib( animatingPr, animatingPr);
629 } 625 }
630 626
631 627
632 //TODO: look at architecting cleanest separation between request handler 628 //TODO: look at architecting cleanest separation between request handler
633 // and master loop, for dissipate, create, shutdown, and other non-semantic 629 // and master loop, for dissipate, create, shutdown, and other non-semantic
662 * point is it sure that all results have completed. 658 * point is it sure that all results have completed.
663 */ 659 */
664 void 660 void
665 VMS__shutdown() 661 VMS__shutdown()
666 { int coreIdx; 662 { int coreIdx;
667 VirtProcr *shutDownPr; 663 //Send a shutdown Request to all MasterLoops.
668
669 //create the shutdown processors, one for each core loop -- put them
670 // directly into the Q -- each core will die when gets one
671 for( coreIdx=0; coreIdx < NUM_CORES; coreIdx++ ) 664 for( coreIdx=0; coreIdx < NUM_CORES; coreIdx++ )
672 { //Note, this is running in the master 665 { //Note, this is running in the master
673 shutDownPr = VMS__create_procr( &endOSThreadFn, NULL ); 666 InterVMSCoreReqst *shutdownReqst = VMS__malloc(sizeof(InterVMSCoreReqst));
674 writeVMSQ( shutDownPr, _VMSMasterEnv->readyToAnimateQs[coreIdx] ); 667 shutdownReqst->secondReqType = shutdownVP;
668 sendInterMasterReqst(coreIdx, (InterMasterReqst*)shutdownReqst);
675 } 669 }
676 670
677 } 671 }
678 672
679 673
688 * processor that animates this function, (this fn is transfering the 682 * processor that animates this function, (this fn is transfering the
689 * animator of the AppVP that is in turn animating this function over 683 * animator of the AppVP that is in turn animating this function over
690 * to core loop function -- note that this slices out a level of virtual 684 * to core loop function -- note that this slices out a level of virtual
691 * processors). 685 * processors).
692 */ 686 */
687 /*
693 void 688 void
694 endOSThreadFn( void *initData, VirtProcr *animatingPr ) 689 endOSThreadFn( void *initData, VirtProcr *animatingPr )
695 { 690 {
696 #ifdef SEQUENTIAL 691 #ifdef SEQUENTIAL
697 asmTerminateCoreLoopSeq(animatingPr); 692 asmTerminateCoreLoopSeq(animatingPr);
698 #else 693 #else
699 asmTerminateCoreLoop(animatingPr); 694 asmTerminateCoreLoop(animatingPr);
700 #endif 695 #endif
701 } 696 }
697 */
702 698
703 699
704 /*This is called from the startup & shutdown 700 /*This is called from the startup & shutdown
705 */ 701 */
706 void 702 void