$PAGE                                                                   00001000
<<***********************************************************>>         00002000
<<***********************************************************>>         00003000
<<********************                   ********************>>         00004000
<<********************       jpcnt       ********************>>         00005000
<<********************                   ********************>>         00006000
<<***********************************************************>>         00007000
<<***********************************************************>>         00008000
<<                                                           >>         00009000
<< the jpcnt table is divided into two parts:                >>         00010000
<<                                                           >>         00011000
<<     a) header - consists of two words                     >>         00012000
<<        0) maximum number of configured jobs plus maximum  >>         00013000
<<           number of configured sessions.                  >>         00014000
<<        1) total number of free entries.                   >>         00015000
<<        2) next available word in bit map to begin search  >>         00016000
<<           of next free entry.                             >>         00017000
<<                                                           >>         00018000
<<     b) job process count bit map - size is configurable.  >>         00019000
<<        each entry is one bit, with a 1 signifying a free  >>         00020000
<<        entry and a 0 if it's in use.                      >>         00021000
<<                                                           >>         00022000
<< the jpcnt table is used to ensure that every job or       >>         00023000
<< session has it's own unique number.  this number is stored>>         00024000
<< in pxglob word 4 of the users stack.  this number is used >>         00025000
<< to get a job sir (jir) that is unique to this job or      >>         00026000
<< session which will ensure exclusive access by any single  >>         00027000
<< process within this job or session when accessing the jdt.>>         00028000
<<                                                           >>         00029000
<< the next available word entry is an index into the bit    >>         00030000
<< map.  it references that word in the bit map where one    >>         00031000
<< will set a free bit (entry) to "used".  the next available>>         00032000
<< word is only to assist in the search of allocating a new  >>         00033000
<< entry.  it is very well possible that free entries are    >>         00034000
<< available before the next free word, but then you spend   >>         00035000
<< more time searching for it.                               >>         00036000
<<                                                           >>         00037000
$page                                                                   00038000
<<                                                           >>         00039000
<<              jpcnt - job process count table              >>         00040000
<<      (1 bit entry for each executing job or session)      >>         00041000
<<                ****** core resident ******                >>         00042000
<<                                                           >>         00043000
<< sysglob base = db+13(%15)                                 >>         00044000
<< dst = 24(%30)                                             >>         00045000
<< sir = 13(%15)                                             >>         00046000
<<                                                           >>         00047000
<<          |----------------------------------|             >>         00048000
<<         0| total configured number of  jobs |             >>         00049000
<<          |      and sessions (maxi)         |             >>         00050000
<<          |----------------------------------|             >>         00051000
<<         1| total number of free entries     |             >>         00052000
<<          |                                  |             >>         00053000
<<          |----------------------------------|             >>         00054000
<<         2| next avail. word for free entry  |             >>         00055000
<<          |                                  |             >>         00056000
<<          |----------------------------------|             >>         00057000
<<         3|     spare word for future        |             >>         00058000
<<          |                                  |             >>         00059000
<<  =====   |----------------------------------|             >>         00060000
<<    |     | job process count bit map        |             >>         00061000
<<    |     ~                                  ~             >>         00062000
<<  maxi                                                     >>         00063000
<<    |     ~                                  ~             >>         00064000
<<    |     |                                  |             >>         00065000
<<  =====   |----------------------------------|             >>         00066000
<<                                                           >>         00067000
<< to reference these defines, there must be an integer array>>         00068000
<< pointing to the beginning of the table (db+0 if using an  >>         00069000
<< exchangedb) and an integer jpcntindex that has a value    >>         00070000
<< from 0 to the maximum number of words-1 used to index     >>         00071000
<< through the jpcnt bit map.                                >>         00072000
<<***********************************************************>>         00073000
<<******************** start of equates *********************>>         00074000
<<***********************************************************>>         00075000
                                                                        00076000
equate                                                                  00077000
  bitoffset         =  4,                                               00078000
  jpcntdst          =  24,                                              00079000
  jpcntsir          =  13,                                              00080000
  jpcntbitmapwords  =  64;                                              00081000
define                                                                  00082000
  jpcntmaxentries   =  jpcntarr(0)#,                                    00083000
  jpcntfreentries   =  jpcntarr(1)#,                                    00084000
  jpcntnextavail    =  jpcntarr(2)#,                                    00085000
  jpcntspare        =  jpcntarr(3)#,                                    00086000
  jpcntbitmap       =  jpcntarr(bitoffset+jpcntindex)#;                 00087000
<<                                                           >>         00088000
<<  note:  allocating and entry, jpcntindex=jpcntnextavail   >>         00089000
<<         deallocating an entry, jpcntindex=wordset         >>         00090000
<<  jpcntspare is reserved for any possible additions        >>         00091000
<<                                                           >>         00092000
<<***********************************************************>>         00093000
<<***********************************************************>>         00094000
<<****************                           ****************>>         00095000
<<**************** end of jpcnt include file ****************>>         00096000
<<***********************************************************>>         00097000
