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