Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > SSR_impls > SSR__MC_shared_impl
comparison SSR.c @ 78:0d04c3e608cc
Creating a new branch for development of the DKU Pattern
| author | Sean Halle <seanhalle@yahoo.com> |
|---|---|
| date | Sun, 26 Aug 2012 02:49:34 -0700 |
| parents | 8882e795016d |
| children | ee8510009267 |
comparison
equal
deleted
inserted
replaced
| 4:f8122c0ba6a5 | 7:7d216a8eb6ef |
|---|---|
| 601 | 601 |
| 602 return receivePr->dataRetFromReq; | 602 return receivePr->dataRetFromReq; |
| 603 } | 603 } |
| 604 | 604 |
| 605 | 605 |
| 606 //============================== DKU ================================ | |
| 607 | |
| 608 /*The DKU pattern is instantiated by registering a divider, a kernel, | |
| 609 * and an undivider. These are done by appropriate VMS_App__ calls. | |
| 610 *For now, think that things like WorkTable will want their own interface | |
| 611 * for divider and undivider.. so here, just do traditional DKU, with the | |
| 612 * DKUPiece data struct (include a field for passing info from divider | |
| 613 * to unidivider) | |
| 614 */ | |
| 615 void | |
| 616 VMS_App__register_DKU_divider( DKUID ID, DKUDividerFn dividerFn, | |
| 617 SlaveVP *animSlv ) | |
| 618 { | |
| 619 | |
| 620 } | |
| 621 | |
| 622 /*The kernel has no context, so it's created as a task, but it can | |
| 623 * communicate, so a suspendable task, just like in VSs. | |
| 624 *Will put this DKU into VSs first.. and thinking about forcing every | |
| 625 * language to support both tasks and VPs. | |
| 626 */ | |
| 627 void | |
| 628 VMS_App__register_DKU_kernel( DKUID ID, DKUKernelFn kernelFn, | |
| 629 SlaveVP *animSlv ) | |
| 630 { | |
| 631 | |
| 632 } | |
| 633 | |
| 634 void | |
| 635 VMS_App__register_DKU_undivider( DKUID ID, DKUUndividerFn undividerFn, | |
| 636 SlaveVP *animSlv ) | |
| 637 { | |
| 638 | |
| 639 } | |
| 640 | |
| 641 DKUInst * | |
| 642 VMS_DKU__make_DKU_Instance( DKUInstID DKU_INST_ID ) | |
| 643 { int oldSz, i; | |
| 644 DKUInstStruc **oldArray; | |
| 645 | |
| 646 DKUEnvironStruc *E = BLIS__BLISEnvironment->DKUEnvironment; | |
| 647 | |
| 648 if( E->numDKUInstances <= DKU_INST_ID) E->numDKUInstances = DKU_INST_ID+1; | |
| 649 if( DKU_INST_ID >= E->instArraySz ) | |
| 650 { //full, so make bigger | |
| 651 oldSz = E->instArraySz; | |
| 652 oldArray = E->DKUInstStrucs; | |
| 653 E->instArraySz *= 2; | |
| 654 E->DKUInstStrucs = malloc( E->instArraySz * sizeof(DKUInstStruc *) ); | |
| 655 for( i = 0; i < oldSz; i++ ) | |
| 656 { E->DKUInstStrucs[i] = oldArray[i]; | |
| 657 } | |
| 658 free( oldArray ); | |
| 659 } | |
| 660 E->DKUInstStrucs[ DKU_INST_ID ] = makeDKUInstStruc( DKU_INST_ID ); | |
| 661 return E->DKUInstStrucs[ DKU_INST_ID ]; | |
| 662 } | |
| 663 | |
| 664 | |
| 606 //=========================================================================== | 665 //=========================================================================== |
| 607 // | 666 // |
| 608 /*A function singleton is a function whose body executes exactly once, on a | 667 /*A function singleton is a function whose body executes exactly once, on a |
| 609 * single core, no matter how many times the fuction is called and no | 668 * single core, no matter how many times the fuction is called and no |
| 610 * matter how many cores or the timing of cores calling it. | 669 * matter how many cores or the timing of cores calling it. |
