VMS/VMS_Implementations/VMS_impls/VMS__MC_shared_impl

view PR__PI.h @ 286:b02b34681414

VReo V2 -- saves checker and doer fn with the port, where triggered
author Sean Halle <seanhalle@yahoo.com>
date Wed, 10 Jul 2013 14:49:04 -0700
parents bc5030385120
children 15ee3fe10e3d
line source
1 /*
2 * Copyright 2009 OpenSourceResearchInstitute.org
3 * Licensed under GNU General Public License version 2
4 *
5 * Author: seanhalle@yahoo.com
6 *
7 */
9 #ifndef _PR__PI_H
10 #define _PR__PI_H
11 #define _GNU_SOURCE
14 #include "PR_primitive_data_types.h"
16 //========================= Function Prototypes ===========================
17 /* MEANING OF WL PI SS int PROS
18 * These indicate which places the function is safe to use. They stand for:
19 *
20 * WL Wrapper Library -- wrapper lib code should only use these
21 * PI Plugin -- plugin code should only use these
22 * SS Startup and Shutdown -- designates these relate to startup & shutdown
23 * int32internal to PR -- should not be used in wrapper lib or plugin
24 * PROS means "OS functions for applications to use"
25 *
26 * PR_int__ functions touch internal PR data structs and are only safe
27 * to be used inside the master lock. However, occasionally, they appear
28 * in wrapper-lib or plugin code. In those cases, very careful analysis
29 * has been done to be sure no concurrency issues could arise.
30 *
31 * PR_WL__ functions are all safe for use outside the master lock.
32 *
33 * PROS are only safe for applications to use -- they're like a second
34 * language mixed in -- but they can't be used inside plugin code, and
35 * aren't meant for use in wrapper libraries, because they are themselves
36 * wrapper-library calls!
37 */
39 #define \
40 PR_PI__create_slaveVP PR_int__create_slaveVP_helper
42 //==============
43 //=== Lang Data
44 //=
45 #define \
46 PR_PI__give_lang_data_from_slave PR_int__give_lang_data_from_slave
47 #define \
48 PR_SS__give_lang_data_from_slave PR_int__give_lang_data_from_slave
51 //============
52 //=== Lang Env
53 //=
54 #define \
55 PR_PI__give_proto_lang_env_for_slave PR_int__give_proto_lang_env_for_slave
56 #define \
57 PR_PI__give_lang_env_for_slave PR_int__give_lang_env_for_slave
58 #define \
59 PR_PI__give_lang_env_from_process PR_int__give_lang_env_from_process
62 //=========
63 //=== Meta Task
64 //=
65 #define \
66 PR_PI__give_lang_meta_task_from_slave PR_int__give_lang_meta_task_from_slave
67 #define \
68 PR_PI__give_prolog_of_lang_meta_task PR_int__give_prolog_of_lang_meta_task
70 SlaveVP *
71 PR_PI__give_slave_lang_meta_task_is_assigned_to( void *langMetaTask );
73 #define \
74 PR_PI__free_lang_meta_task_and_remove_from_slave PR_int__free_lang_meta_task_and_remove_from_coll
76 #define \
77 PR_PI__free_lang_meta_task PR_int__free_lang_meta_task
79 void
80 PR_PI__set_no_del_flag_in_lang_meta_task( void *langMetaTask );
81 void
82 PR_PI__clear_no_del_flag_in_lang_meta_task( void *langMetaTask );
84 //==========
85 //===
86 //=
87 #define \
88 PR_PI__give_ID_from_lang_meta_task PR__give_ID_from_lang_meta_task
89 #define \
90 PR_PI__give_ID_from_slave PR__give_ID_from_slave
92 //=============
93 //===
94 //=
95 #define \
96 PR_PI__put_slave_into_slot PR_int__put_slave_into_slot
97 #define \
98 PR_PI__put_task_into_slot PR_int__put_task_into_slot
100 PRReqst *
101 PR_PI__take_next_request_out_of( SlaveVP *slaveWithReq );
103 #define \
104 PR_PI__take_lang_reqst_from( req ) req->langReq
106 void
107 PR_PI__resume_slave_in_PRServ( SlaveVP *slave );
109 #define \
110 PR_PI__malloc PR_int__malloc
111 #define \
112 PR_PI__malloc_aligned PR_int__malloc_aligned
113 #define \
114 PR_PI__free PR_int__free
117 #define \
118 PR_PI__throw_exception PR_int__throw_exception
120 //=============== Startup and Shutdown ================
121 //===
122 //=
123 void
124 PR_SS__create_topEnv();
126 AnimSlot **
127 PR_SS__create_anim_slots( int32 coreSlotsAreOn );
129 void
130 PR_SS__create_the_coreCtlr_OS_threads();
132 //===================
133 void *
134 PR_SS__create_lang_env( int32 size, SlaveVP *slave, int32 magicNum );
136 void
137 PR_SS__register_assigner( SlaveAssigner assigner, SlaveVP *seedVP, int32 magicNum );
138 void
139 PR_SS__register_lang_shutdown_handler( LangShutdownHdlr shutdownHdlr, SlaveVP *seedVP,
140 int32 magicNum );
141 void
142 PR_SS__register_lang_data_creator( LangDataCreator langDataCreator,
143 SlaveVP *seedVP, int32 magicNum );
144 void
145 PR_SS__register_lang_meta_task_creator( LangDataCreator langMetaTaskCreator,
146 SlaveVP *seedVP, int32 magicNum );
147 void
148 PR_SS__register_make_slave_ready_fn( MakeSlaveReadyFn fn, SlaveVP *seedVP,
149 int32 magicNum );
150 void
151 PR_SS__register_make_task_ready_fn( MakeTaskReadyFn fn, SlaveVP *seedVP,
152 int32 magicNum );
153 //===================
155 void
156 PR_SS__end_process_normally( PRProcess *process );
158 void
159 PR_SS__shutdown_OS_threads();
161 SlaveVP*
162 PR_SS__create_shutdown_slave();
164 void
165 PR_SS__cleanup_at_end_of_shutdown();
167 void
168 PR_SS__print_out_measurements();
170 void
171 PR_SS__wait_for_PR_to_shutdown();
174 //=============================
175 //===
176 //=
178 #define \
179 PR_SS__give_proto_lang_env_for_slave PR_int__give_proto_lang_env_for_slave
181 #define \
182 PR_SS__give_lang_meta_task_from_slave PR_int__give_lang_meta_task_from_slave
183 #define \
184 PR_SS__give_lang_env_for_slave PR_int__give_lang_env_for_slave
185 #define \
186 PR_SS__give_lang_env_from_process PR_int__give_lang_env_from_process
188 #define \
189 PR_SS__malloc PR_WL__malloc /*SS happens outside the Master*/
190 #define \
191 PR_SS__free PR_WL__free
193 //================================================
194 #endif /* _PR__PI_H */