Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > SSR_impls > SSR__MC_shared_impl
diff SSR.h @ 6:98fd084badde
Works multi-core.. pinned VP to a coreloop, changed to SSR
| author | Me |
|---|---|
| date | Wed, 01 Sep 2010 08:22:54 -0700 |
| parents | |
| children | bcc22f6f11a5 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/SSR.h Wed Sep 01 08:22:54 2010 -0700 1.3 @@ -0,0 +1,126 @@ 1.4 +/* 1.5 + * Copyright 2009 OpenSourceStewardshipFoundation.org 1.6 + * Licensed under GNU General Public License version 2 1.7 + * 1.8 + * Author: seanhalle@yahoo.com 1.9 + * 1.10 + */ 1.11 + 1.12 +#ifndef _SSR_H 1.13 +#define _SSR_H 1.14 + 1.15 +#include "VMS/Queue_impl/PrivateQueue.h" 1.16 +#include "VMS/Hash_impl/PrivateHash.h" 1.17 +#include "VMS/VMS.h" 1.18 + 1.19 +/*This header defines everything specific to the SSR semantic plug-in 1.20 + */ 1.21 +typedef struct _SSRSemReq SSRSemReq; 1.22 + 1.23 + 1.24 +/*Semantic layer-specific data sent inside a request from lib called in app 1.25 + * to request handler called in MasterLoop 1.26 + */ 1.27 +enum SSRReqType 1.28 + { 1.29 + send_type = 1, 1.30 + send_from_to, 1.31 + receive_any, //order and grouping matter -- send before receive 1.32 + receive_type, // and receive_any first of the receives -- Handlers 1.33 + receive_from_to,// rely upon this ordering of enum 1.34 + transfer_to, 1.35 + transfer_out 1.36 + }; 1.37 + 1.38 +struct _SSRSemReq 1.39 + { enum SSRReqType reqType; 1.40 + VirtProcr *sendPr; 1.41 + VirtProcr *receivePr; 1.42 + int32 msgType; 1.43 + void *msg; 1.44 + SSRSemReq *nextReqInHashEntry; 1.45 + } 1.46 +/* SSRSemReq */; 1.47 + 1.48 +typedef struct 1.49 + { 1.50 + PrivQueueStruc **readyVPQs; 1.51 + HashTable *commHashTbl; 1.52 + int numVirtPr; 1.53 + int nextCoreToGetNewPr; 1.54 + } 1.55 +SSRSemEnv; 1.56 + 1.57 + 1.58 +//=========================================================================== 1.59 + 1.60 +void 1.61 +SSR__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData ); 1.62 + 1.63 +//======================= 1.64 + 1.65 +void 1.66 +SSR__init(); 1.67 + 1.68 +void 1.69 +SSR__cleanup_after_shutdown(); 1.70 + 1.71 +//======================= 1.72 + 1.73 +inline VirtProcr * 1.74 +SSR__create_procr_with( VirtProcrFnPtr fnPtr, void *initData, 1.75 + VirtProcr *creatingPr ); 1.76 + 1.77 +void 1.78 +SSR__dissipate_procr( VirtProcr *procrToDissipate ); 1.79 + 1.80 +//======================= 1.81 +void * 1.82 +SSR__malloc_size_to( int numBytes, VirtProcr *ownerPr ); 1.83 + 1.84 +void 1.85 +SSR__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr, 1.86 + VirtProcr *newOwnerPr ); 1.87 + 1.88 +void 1.89 +SSR__add_ownership_by_to( VirtProcr *newOwnerPr, void *data ); 1.90 + 1.91 +void 1.92 +SSR__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing ); 1.93 + 1.94 +void 1.95 +SSR__transfer_ownership_to_outside( void *dataToTransferOwnershipOf ); 1.96 + 1.97 + 1.98 + 1.99 +//======================= 1.100 +void 1.101 +SSR__send_of_type_to( VirtProcr *sendPr, void *msg, const int type, 1.102 + VirtProcr *receivePr); 1.103 + 1.104 +void 1.105 +SSR__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr); 1.106 + 1.107 +void * 1.108 +SSR__receive_type_to( const int type, VirtProcr *receivePr ); 1.109 + 1.110 +void * 1.111 +SSR__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr ); 1.112 + 1.113 + 1.114 +//======================= 1.115 + 1.116 +void 1.117 +SSR__free_semantic_request( SSRSemReq *semReq ); 1.118 + 1.119 + 1.120 +//========================= Internal use only ============================= 1.121 +void 1.122 +SSR__Request_Handler( VirtProcr *requestingPr, void *_semEnv ); 1.123 + 1.124 +VirtProcr * 1.125 +SSR__schedule_virt_procr( void *_semEnv, int coreNum ); 1.126 + 1.127 + 1.128 +#endif /* _SSR_H */ 1.129 +
