Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > SSR_impls > SSR__MC_shared_impl
view SSR.h @ 11:9172ea309065
Changed name of SingleMaster branch to SSR also
| author | Me |
|---|---|
| date | Wed, 01 Sep 2010 09:14:56 -0700 |
| parents | |
| children |
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 *readyVirtProcrQ;
48 HashTable *commHashTbl;
49 int numVirtPr;
50 }
51 SSRSemEnv;
54 //===========================================================================
56 void
57 SSR__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData );
59 //=======================
61 void
62 SSR__init();
64 void
65 SSR__cleanup_after_shutdown();
67 //=======================
69 inline VirtProcr *
70 SSR__create_procr_with( VirtProcrFnPtr fnPtr, void *initData,
71 VirtProcr *creatingPr );
73 void
74 SSR__dissipate_procr( VirtProcr *procrToDissipate );
76 //=======================
77 void *
78 SSR__malloc_size_to( int numBytes, VirtProcr *ownerPr );
80 void
81 SSR__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr,
82 VirtProcr *newOwnerPr );
84 void
85 SSR__add_ownership_by_to( VirtProcr *newOwnerPr, void *data );
87 void
88 SSR__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing );
90 void
91 SSR__transfer_ownership_to_outside( void *dataToTransferOwnershipOf );
95 //=======================
96 void
97 SSR__send_of_type_to( VirtProcr *sendPr, void *msg, const int type,
98 VirtProcr *receivePr);
100 void
101 SSR__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr);
103 void *
104 SSR__receive_type_to( const int type, VirtProcr *receivePr );
106 void *
107 SSR__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr );
110 //=======================
112 void
113 SSR__free_semantic_request( SSRSemReq *semReq );
116 //========================= Internal use only =============================
117 void
118 SSR__Request_Handler( VirtProcr *requestingPr, void *_semEnv );
120 VirtProcr *
121 SSR__schedule_virt_procr( void *_semEnv );
124 #endif /* _SSR_H */
