HP OpenVMS Systems

ask the wizard
Content starts here

Commons and Detached Processes?

» close window

The Question is:

 
We have to migrate an application from a VAX3500 to an Alpha-System. We must
start detached processes which use a BLOCK_DATA. When we link these programs
with the BLOCK_DATA, they do not run as detached. Without BLOCK_DATA they
run as detached. When we st
art the programs not as detached for debuging they also run with BLOCK_DATA.
What must we do?
 
A sample code:
$ file comtest.inc:
 
      character*4 testpid
      character*4 testpid2
      common /work_area/ testpid,testpid2
 
$ file inc_common.for:
 
      BLOCKDATA BKD
 
      include 'erlemann:comtest.inc'
 
      end
 
$ file income.for:
 
      program income
 
      include 'erlemann:comtest.inc'
 
      testpid = '2332'
      testpid2 = '1234'
      write(*,100) testpid
      write(*,100) testpid2
100   format(1h,A4)
      end
 
$ file report.for:
 
      program report
 
      include 'erlemann:comtest.inc'
 
      write(*,100) testpid
      write(*,100) testpid2
100   format(1h,A4)
      end
 
$ file testdetach.for:
 
      program report
 
      include 'erlemann:comtest.inc'
 
      do while(.true.)
 
      enddo
 
100   format(1h,A4)
      end
 
$ Fortran and Link commands:
 
$ for /align=all inc_common
$ link /share inc_common , sys$input/option
        symbol_vector=(work_area=psect)
        psect_attr=work_area,shr
$  DEFINE/GROUP PRJTST ERLEMANN:INC_COMMON.EXE
$!
$  RUN SYS$SYSTEM:INSTALL
           PRJTST/WRITE/SHARE
$!
$ for /align=all income
$ for /align=all report
$ for /align=all testdetach
$!
$ link /share income , -
       sys$input/option
       prjtst/share
       psect_attr=work_area,shr
$ link /share report , -
       sys$input/option
       prjtst/share
       psect_attr=work_area,shr
$ link /share testdetach , -
       sys$input/option
       prjtst/share
       psect_attr=work_area,shr
 
$ run income                  --> ok
$ run report                  --> ok
$ run /detached testdetach    --> doesnt run
 
 


The Answer is :

 
  Please see the existing discussion of COMMONs here in Ask The Wizard.
 
  Ensure that the logical names PRJTST and ERLEMANN are visible to the
  detached process, and consider defining them using an /EXECUTIVE mode
  definition.
 
  Check the exit status for the detached process using system accounting.
 
  You might want to place some code in the DO loop such as a WRITE, to
  ensure that the loop is not entirely optimized away.
 
  Though it does not immediately appear to be the case here, please be
  aware that detached processes do not include a command line interface
  (CLI), unless one is specifically requested.  Please see the OpenVMS
  Frequently Asked Questions (FAQ) for further details on this topic.
 
  OpenVMS shareable images such as INCOME, REPORT, and TESTDETACH are
  not directly RUN, only executable images are directly RUN.  In other
  words, specification of LINK /SHARE for these images is unusual and
  typically not recommended.
 

answer written or last revised on ( 20-AUG-1999 )

» close window