Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > SSR_impls > SSR__MC_shared_impl
comparison SSR.h @ 13:9508be8a8b35
fixed bug in new procr creation & comment
| author | Me |
|---|---|
| date | Tue, 05 Oct 2010 09:55:49 -0700 |
| parents | |
| children | bcc22f6f11a5 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:a41b0254f8f6 |
|---|---|
| 1 /* | |
| 2 * Copyright 2009 OpenSourceStewardshipFoundation.org | |
| 3 * Licensed under GNU General Public License version 2 | |
| 4 * | |
| 5 * Author: seanhalle@yahoo.com | |
| 6 * | |
| 7 */ | |
| 8 | |
| 9 #ifndef _SSR_H | |
| 10 #define _SSR_H | |
| 11 | |
| 12 #include "VMS/Queue_impl/PrivateQueue.h" | |
| 13 #include "VMS/Hash_impl/PrivateHash.h" | |
| 14 #include "VMS/VMS.h" | |
| 15 | |
| 16 /*This header defines everything specific to the SSR semantic plug-in | |
| 17 */ | |
| 18 typedef struct _SSRSemReq SSRSemReq; | |
| 19 | |
| 20 | |
| 21 /*Semantic layer-specific data sent inside a request from lib called in app | |
| 22 * to request handler called in MasterLoop | |
| 23 */ | |
| 24 enum SSRReqType | |
| 25 { | |
| 26 send_type = 1, | |
| 27 send_from_to, | |
| 28 receive_any, //order and grouping matter -- send before receive | |
| 29 receive_type, // and receive_any first of the receives -- Handlers | |
| 30 receive_from_to,// rely upon this ordering of enum | |
| 31 transfer_to, | |
| 32 transfer_out | |
| 33 }; | |
| 34 | |
| 35 struct _SSRSemReq | |
| 36 { enum SSRReqType reqType; | |
| 37 VirtProcr *sendPr; | |
| 38 VirtProcr *receivePr; | |
| 39 int32 msgType; | |
| 40 void *msg; | |
| 41 SSRSemReq *nextReqInHashEntry; | |
| 42 } | |
| 43 /* SSRSemReq */; | |
| 44 | |
| 45 typedef struct | |
| 46 { | |
| 47 PrivQueueStruc **readyVPQs; | |
| 48 HashTable *commHashTbl; | |
| 49 int numVirtPr; | |
| 50 int nextCoreToGetNewPr; | |
| 51 } | |
| 52 SSRSemEnv; | |
| 53 | |
| 54 | |
| 55 //=========================================================================== | |
| 56 | |
| 57 void | |
| 58 SSR__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData ); | |
| 59 | |
| 60 //======================= | |
| 61 | |
| 62 void | |
| 63 SSR__init(); | |
| 64 | |
| 65 void | |
| 66 SSR__cleanup_after_shutdown(); | |
| 67 | |
| 68 //======================= | |
| 69 | |
| 70 inline VirtProcr * | |
| 71 SSR__create_procr_with( VirtProcrFnPtr fnPtr, void *initData, | |
| 72 VirtProcr *creatingPr ); | |
| 73 | |
| 74 void | |
| 75 SSR__dissipate_procr( VirtProcr *procrToDissipate ); | |
| 76 | |
| 77 //======================= | |
| 78 void * | |
| 79 SSR__malloc_size_to( int numBytes, VirtProcr *ownerPr ); | |
| 80 | |
| 81 void | |
| 82 SSR__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr, | |
| 83 VirtProcr *newOwnerPr ); | |
| 84 | |
| 85 void | |
| 86 SSR__add_ownership_by_to( VirtProcr *newOwnerPr, void *data ); | |
| 87 | |
| 88 void | |
| 89 SSR__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing ); | |
| 90 | |
| 91 void | |
| 92 SSR__transfer_ownership_to_outside( void *dataToTransferOwnershipOf ); | |
| 93 | |
| 94 | |
| 95 | |
| 96 //======================= | |
| 97 void | |
| 98 SSR__send_of_type_to( VirtProcr *sendPr, void *msg, const int type, | |
| 99 VirtProcr *receivePr); | |
| 100 | |
| 101 void | |
| 102 SSR__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr); | |
| 103 | |
| 104 void * | |
| 105 SSR__receive_type_to( const int type, VirtProcr *receivePr ); | |
| 106 | |
| 107 void * | |
| 108 SSR__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr ); | |
| 109 | |
| 110 | |
| 111 //======================= | |
| 112 | |
| 113 void | |
| 114 SSR__free_semantic_request( SSRSemReq *semReq ); | |
| 115 | |
| 116 | |
| 117 //========================= Internal use only ============================= | |
| 118 void | |
| 119 SSR__Request_Handler( VirtProcr *requestingPr, void *_semEnv ); | |
| 120 | |
| 121 VirtProcr * | |
| 122 SSR__schedule_virt_procr( void *_semEnv, int coreNum ); | |
| 123 | |
| 124 | |
| 125 #endif /* _SSR_H */ | |
| 126 |
