$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
