Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > SSR_impls > SSR__MC_shared_impl
view SSR.h @ 15:6eb80110976c
change req for new procr to sync with change in VMS
| author | Me |
|---|---|
| date | Sun, 10 Oct 2010 09:42:24 -0700 |
| parents | 98fd084badde |
| children | 6c6d7fbd7e25 |
line source
1 /*
2 * Copyright 2009 OpenSourceStewardshipFoundation.org
3 * Licensed under GNU General Public License version 2
4 *
5 * Author: seanhalle@yahoo.com
6 *
7 */
9 #ifndef _SSR_H
10 #define _SSR_H
12 #include "VMS/Queue_impl/PrivateQueue.h"
13 #include "VMS/Hash_impl/PrivateHash.h"
14 #include "VMS/VMS.h"
16 /*This header defines everything specific to the SSR semantic plug-in
17 */
18 typedef struct _SSRSemReq SSRSemReq;
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 };
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 */;
45 typedef struct
46 {
47 PrivQueueStruc **readyVPQs;
48 HashTable *commHashTbl;
49 int32 numVirtPr;
50 int32 nextCoreToGetNewPr;
51 int32 primitiveStartTime;
52 }
53 SSRSemEnv;
56 //===========================================================================
58 void
59 SSR__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData );
61 int32
62 SSR__giveMinWorkUnitCycles( float32 percentOverhead );
64 void inline
65 SSR__start_primitive();
67 int32 inline
68 SSR__end_primitive_and_give_cycles();
71 //=======================
73 void
74 SSR__init();
76 void
77 SSR__cleanup_after_shutdown();
79 //=======================
81 inline VirtProcr *
82 SSR__create_procr_with( VirtProcrFnPtr fnPtr, void *initData,
83 VirtProcr *creatingPr );
85 void
86 SSR__dissipate_procr( VirtProcr *procrToDissipate );
88 //=======================
89 void *
90 SSR__malloc_size_to( int numBytes, VirtProcr *ownerPr );
92 void
93 SSR__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr,
94 VirtProcr *newOwnerPr );
96 void
97 SSR__add_ownership_by_to( VirtProcr *newOwnerPr, void *data );
99 void
100 SSR__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing );
102 void
103 SSR__transfer_ownership_to_outside( void *dataToTransferOwnershipOf );
107 //=======================
108 void
109 SSR__send_of_type_to( VirtProcr *sendPr, void *msg, const int type,
110 VirtProcr *receivePr);
112 void
113 SSR__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr);
115 void *
116 SSR__receive_type_to( const int type, VirtProcr *receivePr );
118 void *
119 SSR__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr );
122 //=======================
124 void
125 SSR__free_semantic_request( SSRSemReq *semReq );
128 //========================= Internal use only =============================
129 void
130 SSR__Request_Handler( VirtProcr *requestingPr, void *_semEnv );
132 VirtProcr *
133 SSR__schedule_virt_procr( void *_semEnv, int coreNum );
136 #endif /* _SSR_H */
