cvs commit: jakarta-tomcat-connectors/jk/native2/include jk_shm.h

2004-03-12 Thread mturk
mturk   2004/03/12 11:12:19

  Modified:jk/native2/include jk_shm.h
  Log:
  Change some struct elements.
  Added inmem and attached flags.
  
  Revision  ChangesPath
  1.10  +15 -4 jakarta-tomcat-connectors/jk/native2/include/jk_shm.h
  
  Index: jk_shm.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_shm.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- jk_shm.h  24 Feb 2004 08:44:39 -  1.9
  +++ jk_shm.h  12 Mar 2004 19:12:19 -  1.10
  @@ -70,8 +70,9 @@
   
   
   struct jk_shm_head {
  -struct jk_shm_slot slot;
   
  +int structSize;
  +
   int slotSize;
   
   int slotMaxCount;
  @@ -82,6 +83,10 @@
   
   /* XXX Need a more generic mechanism */
   int lbVer;
  +
  +/* Array of used slots set to nonzero if used */
  +char slots[1];
  +
   };
   
   
  @@ -132,11 +137,17 @@
   
   int slotMaxCount;
   
  -void *image;
  -
   struct jk_shm_head *head;
   
  -/* Private data */
  +/* Memory image (the data after head)*/
  +void *image;
  +
  +/* Is the shmem attached or created */
  +int attached;
  +
  +/* Use the main memory instead */
  +int inmem;
  +/* Private data (apr_shm_t) */
   void *privateData;
   };
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/jk/native2/include jk_shm.h jk_worker.h jk_workerEnv.h

2002-05-14 Thread costin

costin  02/05/14 13:38:00

  Modified:jk/native2/include jk_shm.h jk_worker.h jk_workerEnv.h
  Log:
  - add a reference to the slot used for endpoint stats
  
  - add 2 more fields to each slot, to support multiple structs.
  
  - add endpointMap to worker - it'll contain all existing endpoints
  in use by a worker
  
  - explicit sync on endpoint creation.
  
  - customizable error code and message if no worker is found
  
  Revision  ChangesPath
  1.5   +3 -0  jakarta-tomcat-connectors/jk/native2/include/jk_shm.h
  
  Index: jk_shm.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_shm.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- jk_shm.h  12 May 2002 01:07:10 -  1.4
  +++ jk_shm.h  14 May 2002 20:38:00 -  1.5
  @@ -99,6 +99,9 @@
   /** Size of the segment */
   int size;
   
  +int structSize;
  +int structCnt;
  +
   /** Full name of the segment. type:localName convention.
*/
   char name[64];
  
  
  
  1.21  +24 -3 jakarta-tomcat-connectors/jk/native2/include/jk_worker.h
  
  Index: jk_worker.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_worker.h,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- jk_worker.h   14 May 2002 17:07:08 -  1.20
  +++ jk_worker.h   14 May 2002 20:38:00 -  1.21
  @@ -58,7 +58,7 @@
   /***
* Description: Workers controller header file *
* Author:  Gal Shachor <[EMAIL PROTECTED]>   * 
  - * Version: $Revision: 1.20 $   *
  + * Version: $Revision: 1.21 $   *
***/
   
   #ifndef JK_WORKER_H
  @@ -94,6 +94,10 @@
   #define JK_LB_LEVELS 4
   #define JK_LB_MAX_WORKERS 256
   
  +/* XXX Separate this in 2 structures: jk_lb.h and jk_ajp.h.
  +   Using 'worker' as a generic term is confusing, the objects are very different.
  + */
  +
   /*
* The worker 'class', which represents something to which the web server
* can delegate requests. 
  @@ -147,11 +151,22 @@
   struct jk_channel *channel;
   char *channelName;
   
  -/** Reuse the endpoint and it's connection
  +/** Reuse the endpoint and it's connection. The cache will contain
  +the 'unused' workers. It's size may be used to select
  +an worker by the lb.
*/
   struct jk_objCache *endpointCache;
  -int cache_sz;
  +
  +/* All endpoints for this worker. Each endpoint is long-lived,
  +   the size of the map will represent the maximum number of connections
  +   active so far.
  + */
  +struct jk_map *endpointMap;
   
  +/* Critical section used for creation of the endpoints
  + */
  +JK_CRIT_SEC cs;
  +
   /** Request pool cache. XXX We may use a pool of requests.
*/
   struct jk_objCache *rPoolCache;
  @@ -211,6 +226,12 @@
   will know this server shouldn't be used for new requests.
   */
   int hwBalanceErr;
  +
  +/* Message to display when no tomcat instance is available
  + * if status=302, this is a redirect location.
  + */
  +char *noWorkerMsg;
  +int  noWorkerCode;
   
   int workerCnt[JK_LB_LEVELS];
   jk_worker_t *workerTables[JK_LB_LEVELS][JK_LB_MAX_WORKERS];
  
  
  
  1.20  +4 -1  jakarta-tomcat-connectors/jk/native2/include/jk_workerEnv.h
  
  Index: jk_workerEnv.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_workerEnv.h,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- jk_workerEnv.h14 May 2002 16:57:37 -  1.19
  +++ jk_workerEnv.h14 May 2002 20:38:00 -  1.20
  @@ -58,7 +58,7 @@
   /***
* Description: Workers controller header file *
* Author:  Gal Shachor <[EMAIL PROTECTED]>   * 
  - * Version: $Revision: 1.19 $   *
  + * Version: $Revision: 1.20 $   *
***/
   
   #ifndef JK_WORKERENV_H
  @@ -234,6 +234,9 @@
   
   struct jk_config *config;
   struct jk_shm *shm;
  +/* Slot for endpoint stats
  + */
  +struct jk_shm_slot *epStat;
   
   /* Handlers. This is a dispatch table for messages, for
* each message id w

cvs commit: jakarta-tomcat-connectors/jk/native2/include jk_shm.h

2002-05-11 Thread nacho

nacho   02/05/11 18:07:10

  Modified:jk/native2/common jk_shm.c
   jk/native2/include jk_shm.h
  Log:
  * Fixed to build in win32
  
  Revision  ChangesPath
  1.13  +9 -9  jakarta-tomcat-connectors/jk/native2/common/jk_shm.c
  
  Index: jk_shm.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_shm.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- jk_shm.c  9 May 2002 23:47:31 -   1.12
  +++ jk_shm.c  12 May 2002 01:07:10 -  1.13
  @@ -111,7 +111,7 @@
   return apr_shm_destroy(aprShm);
   }
   
  -static int jk2_shm_detach(jk_env_t *env, jk_shm_t *shm)
  +static int JK_METHOD jk2_shm_detach(jk_env_t *env, jk_shm_t *shm)
   {
   apr_shm_t *aprShm=(apr_shm_t *)shm->privateData;
   
  @@ -186,7 +186,7 @@
   /* Create or reinit an existing scoreboard. The MPM can control whether
* the scoreboard is shared across multiple processes or not
*/
  -static int  jk2_shm_init(struct jk_env *env, jk_shm_t *shm) {
  +static int JK_METHOD jk2_shm_init(struct jk_env *env, jk_shm_t *shm) {
   apr_status_t rv=APR_SUCCESS;
   jk_shm_head_t *head;
   
  @@ -300,16 +300,16 @@
   
   /* pos starts with 1 ( 0 is the head )
*/
  -jk_shm_slot_t *jk2_shm_getSlot(struct jk_env *env, struct jk_shm *shm, int pos)
  +jk_shm_slot_t * JK_METHOD jk2_shm_getSlot(struct jk_env *env, struct jk_shm *shm, 
int pos)
   {
   if( pos==0 ) return NULL;
   if( shm->image==NULL ) return NULL;
   if( pos > shm->slotMaxCount ) return NULL;
   /* Pointer aritmethic, I hope it's right */
  -return shm->image + pos * shm->slotSize;
  +return (jk_shm_slot_t *)((long)shm->image + (pos * shm->slotSize));
   }
   
  -jk_shm_slot_t *jk2_shm_createSlot(struct jk_env *env, struct jk_shm *shm, 
  +jk_shm_slot_t * JK_METHOD jk2_shm_createSlot(struct jk_env *env, struct jk_shm 
*shm, 
 char *name, int size)
   {
   /* For now all slots are equal size
  @@ -338,7 +338,7 @@
   
   /** Get an ID that is unique across processes.
*/
  -int jk2_shm_getId(struct jk_env *env, struct jk_shm *shm)
  +int JK_METHOD jk2_shm_getId(struct jk_env *env, struct jk_shm *shm)
   {
   
   return 0;
  @@ -346,7 +346,7 @@
   
   
   
  -static int jk2_shm_setAttribute( jk_env_t *env, jk_bean_t *mbean, char *name, void 
*valueP ) {
  +static int JK_METHOD jk2_shm_setAttribute( jk_env_t *env, jk_bean_t *mbean, char 
*name, void *valueP ) {
   jk_shm_t *shm=(jk_shm_t *)mbean->object;
   char *value=(char *)valueP;
   
  @@ -398,7 +398,7 @@
   
   /** Called by java. Will call the right shm method.
*/
  -static int jk2_shm_dispatch(jk_env_t *env, void *target, jk_endpoint_t *ep, 
jk_msg_t *msg)
  +static int JK_METHOD jk2_shm_dispatch(jk_env_t *env, void *target, jk_endpoint_t 
*ep, jk_msg_t *msg)
   {
   jk_bean_t *bean=(jk_bean_t *)target;
   jk_shm_t *shm=(jk_shm_t *)bean->object;
  @@ -454,7 +454,7 @@
   return JK_ERR;
   }
   
  -static int jk2_shm_setWorkerEnv( jk_env_t *env, jk_shm_t *shm, jk_workerEnv_t *wEnv 
) {
  +static int JK_METHOD jk2_shm_setWorkerEnv( jk_env_t *env, jk_shm_t *shm, 
jk_workerEnv_t *wEnv ) {
   wEnv->registerHandler( env, wEnv, "shm",
  "shmDispatch", JK_HANDLE_SHM_DISPATCH,
  jk2_shm_dispatch, NULL );
  
  
  
  1.4   +6 -6  jakarta-tomcat-connectors/jk/native2/include/jk_shm.h
  
  Index: jk_shm.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_shm.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jk_shm.h  25 Apr 2002 18:41:46 -  1.3
  +++ jk_shm.h  12 May 2002 01:07:10 -  1.4
  @@ -145,28 +145,28 @@
   /** Initialize the shared memory area. It'll map the shared memory 
*  segment if it exists, or create and init it if not.
*/
  -int (*init)(struct jk_env *env, struct jk_shm *shm);
  +int (JK_METHOD *init)(struct jk_env *env, struct jk_shm *shm);
   
   /** Detach from the shared memory segment
*/
  -int (*destroy)(struct jk_env *env, struct jk_shm *shm);
  +int (JK_METHOD *destroy)(struct jk_env *env, struct jk_shm *shm);
   
   /** 
*/
  -int (*setWorkerEnv)( struct jk_env *env, struct jk_shm *shm,
  +int (JK_METHOD *setWorkerEnv)( struct jk_env *env, struct jk_shm *shm,
struct jk_workerEnv *wEnv );
   
   /** Get a shm slot. Each slot has different rules for synchronization, based on 
type. 
*/
  -struct jk_shm_slot *(*getSlot)(struct jk_env *env, struct jk_shm *shm, int pos);
  +struct jk_shm_slot *(JK_METHOD *getSlot)(struct jk_env *env, struct jk_shm 
*shm, int pos);
   
   /** Create a slot. This typically involves int

cvs commit: jakarta-tomcat-connectors/jk/native2/include jk_shm.h

2002-04-25 Thread costin

costin  02/04/25 11:41:46

  Modified:jk/native2/include jk_shm.h
  Log:
  Few improvements, expose the head, etc. Still far from completion.
  
  Revision  ChangesPath
  1.3   +51 -6 jakarta-tomcat-connectors/jk/native2/include/jk_shm.h
  
  Index: jk_shm.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_shm.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jk_shm.h  17 Apr 2002 22:46:35 -  1.2
  +++ jk_shm.h  25 Apr 2002 18:41:46 -  1.3
  @@ -73,26 +73,56 @@
   struct jk_shm;
   
   typedef struct jk_shm jk_shm_t;
  +typedef struct jk_shm_slot jk_shm_slot_t;
  +typedef struct jk_shm_head jk_shm_head_t;
   
  +
  +/* That's the default - should be enough for most cases.
  +   8k is what we use as the default packet size in ajp13, and 256
  +   slots should be enough for now ( == 256 workers )
  +   XXX implement the setters to override this
  +*/
  +#define DEFAULT_SLOT_SIZE 1024 * 8
  +#define DEFAULT_SLOT_COUNT 256
  +
  +
  +
   /** Each shared memory slot has at least the following components.
*/
   struct jk_shm_slot {
  -/** Size of the segment */
  -int size;
  -
   /** Version of the segment. Whoever writes it must change the
   version after writing. Various components will check the version
   and refresh if needed
   */
   int ver;
   
  -/** Name of the segment. 
  +/** Size of the segment */
  +int size;
  +
  +/** Full name of the segment. type:localName convention.
*/
  -char type[64];
  +char name[64];
   
   char data[1];
   };
  +
  +
  +struct jk_shm_head {
  +struct jk_shm_slot slot;
  +
  +int slotSize;
   
  +int slotMaxCount;
  +
  +/* Last used position. Increase ( at least atomically, eventually with mutexes )
  +   each time a slot is created */
  +int lastSlot;
  +
  +/* XXX Need a more generic mechanism */
  +int lbVer;
  +};
  +
  +
   /**
*  Shared memory support. This is similar with the scoreboard or jserv's worker 
shm, but
*  organized a bit more generic to support use of shm as a channel and to support 
config
  @@ -121,9 +151,14 @@
*/
   int (*destroy)(struct jk_env *env, struct jk_shm *shm);
   
  +/** 
  + */
  +int (*setWorkerEnv)( struct jk_env *env, struct jk_shm *shm,
  + struct jk_workerEnv *wEnv );
  +
   /** Get a shm slot. Each slot has different rules for synchronization, based on 
type. 
*/
  -struct jk_shm_slot *(*getSlot)(struct jk_env *env, struct jk_shm *shm, char 
*name, int size);
  +struct jk_shm_slot *(*getSlot)(struct jk_env *env, struct jk_shm *shm, int pos);
   
   /** Create a slot. This typically involves inter-process synchronization.
*/
  @@ -132,7 +167,17 @@
   /** Get an ID that is unique across processes.
*/
   int (*getId)(struct jk_env *env, struct jk_shm *shm);
  +
  +int size;
  +
  +int slotSize;
   
  +int slotMaxCount;
  +
  +void *image;
  +
  +struct jk_shm_head *head;
  +
   /* Private data */
   void *privateData;
   };
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: