VMS/VMS_Implementations/VMS_impls/VMS__MC_shared_impl

view PR__WL.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 1d7ea1b0f176
children
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__WL_H
10 #define _PR__WL_H
11 #define _GNU_SOURCE
13 #include "PR_primitive_data_types.h"
14 #include "PR__structs.h"
15 //========================= Function Prototypes ===========================
16 /* MEANING OF WL PI SS int PROS
17 * These indicate which places the function is safe to use. They stand for:
18 *
19 * WL Wrapper Library -- wrapper lib code should only use these
20 * PI Plugin -- plugin code should only use these
21 * SS Startup and Shutdown -- designates these relate to startup & shutdown
22 * int32internal to PR -- should not be used in wrapper lib or plugin
23 * PROS means "OS functions for applications to use"
24 *
25 * PR_int__ functions touch internal PR data structs and are only safe
26 * to be used inside the master lock. However, occasionally, they appear
27 * in wrapper-lib or plugin code. In those cases, very careful analysis
28 * has been done to be sure no concurrency issues could arise.
29 *
30 * PR_WL__ functions are all safe for use outside the master lock.
31 *
32 * PROS are only safe for applications to use -- they're like a second
33 * language mixed in -- but they can't be used inside plugin code, and
34 * aren't meant for use in wrapper libraries, because they are themselves
35 * wrapper-library calls!
36 */
38 //============== Top level Fns called from main ===============
39 void
40 PR__start();
42 PRProcess *
43 PR__create_process( BirthFnPtr seed_Fn, void *seedData );
45 void
46 PR__end_seedVP( SlaveVP *seedSlv );
48 void
49 PR__end_process_from_inside( SlaveVP *seedSlv );
51 void *
52 PR__give_results_from_process_when_ready( PRProcess *process );
54 void
55 PR__wait_for_process_to_end( PRProcess *process );
57 void
58 PR__wait_for_all_activity_to_end();
60 void
61 PR__shutdown();
63 #define \
64 PR__create_taskID_of_size PR_WL__create_taskID_of_size
66 inline
67 int32 *
68 PR__give_ID_from_slave( SlaveVP *animSlv, int32 magicNumber );
70 inline
71 int32 *
72 PR__give_ID_from_lang_meta_task( void *_task );
74 #define \
75 PR__malloc PR_WL__malloc
77 #define \
78 PR__free PR_WL__free
82 //============== include internally used fn prototypes ================
83 #include "PR__int.h"
86 #define \
87 PR_WL__create_slaveVP PR_int__create_slaveVP_helper
89 #define \
90 PR_WL__give_lang_meta_task_from_slave PR_int__give_lang_meta_task_from_slave
92 #define \
93 PR_WL__give_prolog_of_lang_meta_task PR_int__give_prolog_of_lang_meta_task
95 //============== Request Related ===============
97 void
98 PR_WL__suspend_slaveVP_and_send_req( SlaveVP *callingSlv );
100 inline void
101 PR_WL__add_lang_request_in_mallocd_PRReqst( void *langReqData,
102 SlaveVP *callingSlv );
104 inline void
105 PR_WL__send_lang_request( void *langReq, RequestHandler handler,
106 SlaveVP *callingSlv, int32 magicNum );
108 void
109 PR_WL__send_create_slaveVP_req( void *langReq, int32 *ID, CreateHandler handler,
110 SlaveVP *reqstingSlv, int32 magicNum );
112 void inline
113 PR_WL__send_end_slave_req( void *langReq, RequestHandler handler,
114 SlaveVP *slvToDissipate, int32 magicNum );
116 inline void
117 PR_WL__send_service_request( void *langReqData, SlaveVP *callingSlv );
119 inline void
120 PR_WL__send_lang_shutdown_request( SlaveVP *callingSlv, int32 magicNum );
122 inline
123 int32 *
124 PR_WL__create_taskID_of_size( int32 numInts );
126 //======================== MEASUREMENT ======================
127 uint64
128 PR_WL__give_num_plugin_cycles();
129 uint32
130 PR_WL__give_num_plugin_animations();
133 //========================= Utilities =======================
134 void
135 PR_WL__throw_exception( char *msgStr, SlaveVP *reqstSlv, PRExcp *excpData );
136 #define PR_App__throw_exception PR_WL__throw_exception
139 //=======================================================================
141 //========================= Services =======================
142 //#include "Services_Offered_by_PR/Measurement_and_Stats/probes.h"
143 //#include "Services_Offered_by_PR/Services_Language/PRServ.h"
144 //#include "Services_Offered_by_PR/Services_Language/libPRServ.h"
146 //================================================
147 #endif /* _PR_H */