Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > SSR_impls > SSR__MC_shared_impl
view SSR.h @ 16:6c6d7fbd7e25
added ideal num work units plus PRINT_DEBUG as macro
| author | Me |
|---|---|
| date | Thu, 14 Oct 2010 17:06:28 -0700 |
| parents | bcc22f6f11a5 |
| children | bf57b83019e5 |
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();
70 int32
71 SSR__giveIdealNumWorkUnits();
73 //=======================
75 void
76 SSR__init();
78 void
79 SSR__cleanup_after_shutdown();
81 //=======================
83 inline VirtProcr *
84 SSR__create_procr_with( VirtProcrFnPtr fnPtr, void *initData,
85 VirtProcr *creatingPr );
87 void
88 SSR__dissipate_procr( VirtProcr *procrToDissipate );
90 //=======================
91 void *
92 SSR__malloc_size_to( int numBytes, VirtProcr *ownerPr );
94 void
95 SSR__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr,
96 VirtProcr *newOwnerPr );
98 void
99 SSR__add_ownership_by_to( VirtProcr *newOwnerPr, void *data );
101 void
102 SSR__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing );
104 void
105 SSR__transfer_ownership_to_outside( void *dataToTransferOwnershipOf );
109 //=======================
110 void
111 SSR__send_of_type_to( VirtProcr *sendPr, void *msg, const int type,
112 VirtProcr *receivePr);
114 void
115 SSR__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr);
117 void *
118 SSR__receive_type_to( const int type, VirtProcr *receivePr );
120 void *
121 SSR__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr );
124 //=======================
126 void
127 SSR__free_semantic_request( SSRSemReq *semReq );
130 //========================= Internal use only =============================
131 void
132 SSR__Request_Handler( VirtProcr *requestingPr, void *_semEnv );
134 VirtProcr *
135 SSR__schedule_virt_procr( void *_semEnv, int coreNum );
138 #endif /* _SSR_H */
