[an error occurred while processing this directive]

HP OpenVMS Systems

Ask the Wizard
» 

HP OpenVMS Systems

OpenVMS information

» What's new on our site
» Upcoming events
» Configuration and buying assistance
» Send us your comments

HP OpenVMS systems

» OpenVMS software
» Supported Servers
» OpenVMS virtualization
» OpenVMS solutions and partners
» OpenVMS success stories
» OpenVMS service and support
» OpenVMS resources and information
» OpenVMS documentation
» Education and training

Quick Links

» Non-javascript page
» Ask the Wizard
» OpenVMS FAQ

Test Drive OpenVMS

» OpenVMS I64 test drive
» Java test drive

Other information resources available to you include:

» OpenVMS freeware
» ECO kits, software and hardware support, prior version support
» Alpha SRM, ARC, and AlphaBIOS firmware updates
» ENCOMPASS - HP user group
» OpenVMS software downloads, OpenVMS freeware CD-ROM
» OpenVMS firmware locations
» DECconnect passive adaptor charts
» Cables reference guide
» MicroVAX console commands
» OpenVMS student research

Select a topic below to see Questions Frequently Asked by partners

» Using the online documentation library(installing BNU from the asap SDK)
» Global sections(how to create and use.)
» xx$CREATE_BUFOBJ system service(usage)
» Ethernet address(methods of determination)
» Shareable images(cookbook approach to creating one)
» Sharing data/code at absolute addresses(a guide with examples)
» Determining the Alpha microprocessor
» Using GETSYI to get hardware status

Evolving business value

» Business Systems Evolution
» AlphaServer systems transition planning
» Alpha RetainTrust program

Related links

» HP Integrity servers
» HP Alpha systems
» HP storage
» HP software
» HP products and services
» HP solutions
» HP support
disaster proof
HP Integrity server animation
HP Integrity server animation
Content starts here

Ask the Wizard Questions

We have an application which receives messages on a UDP por

The Question is:

on realtime basis from some devices over the Ethernet.
The problem we have is whenever the VAX gets loaded, the
UDP buffer overflows and we end up losing messages.

The current appliction can be represented by following loop -

create a UDP port.
while (true)
begin
  $QIOW on UDP port.
  process_message ()
end

we have incresed the size of UDP buffer and it helps. The # of
lost messages are reduced. I also want to increase the base
prority of this process which recives UDP messages by 3-4
so it does not compete with other interactive processes.
Currently this one runs at base prioority of 4 like all
other interactive process. There are other group of people
which do not want to increase the priority and want to use
ASTs for processing messages. This is where I have some questions
about ASTs.

If modify the above code as -

create a UDP port
QIO on UDP Port wirth Process_Message as AST
Hibernate.

Process_Message();
Wakeup
sys$setast(0) ! disable further interupts.
another QIO with AST Process_message;
do the real processin like before;
sys$setast(1) ! enable interupts
End ! process_message routine

Keeping this in mind here are my questions -
1. Will VMS preempt another process running at same priority
   when AST is delivered, our PRIORITY_OFFSET sysgen parameter is 0.
2. Since I am disabling AST delivery in begining how and
   where VMS would store info about this events?

I had seen a white paper presented at DECUS seminar that
described how ASTs work on VMS and would have answered my
quuestion. If it is still around somewhere I would appreciate
getting a copy.

Thanks,


The Answer is:


   Warning: "realtime" has many meanings.

   Which IP package is in use here?

   Note that network transports and OpenVMS real-time process priorities
   (16+) tend not to mix particularly well, as network support software
   tends to run at non-realtime priorities, and can thus get blocked by
   the realtime activities.

   An AST does not interrupt an AST.

   Here's an example:

     allocate some number of buffer blocks and place them into
	a freelist queue.  (The total can be set at run-time, or
	can be a compile-time value...)

     associate the OpenVMS channel with the UDP port.

     /*
     //	issue a repeating wakeup, every 30 seconds or so -- not strictly
     //  necessary, but often a useful workaround for programming
     //	or queue problems.
     */
     sys$schdwk();

     /*
     //	Start the process running...
     */
     sys$qio on the channel, specifying ProcessMsgAst as the AST

     /*
     //	ASTs hit asynchronous to this `for' loop; this loop keeps
     //	trying to drain the MsgInQueue.  When drained, it sleeps.
     */
     for (1;1;1)
 	{
 	while ( Dequeue( BusyQ ))
	    {
	    ExitApplicationFlag = ProcessMsg();
	    EnQueue( FreeQ );
	    }
	if ( ExitApplicationFlag )
	    break;
	else
	    sys$hiber()
	}
    return SS$_NORMAL;
    }

    ProcessMsg()
	{
	/*
	//  process a message off the queue
	//  performed at non-AST, to prevent blocking ASTs.
	//  release blocks onto the FreeQueue.
	*/
	}
    ProcessMsgAst( ASTPRM )
	{
	/*
	//  pull a new block off the FreeQueue.
	*/
	Dequeue( FreeQ );
        sys$qio on the channel, specifying ProcessMessage
		as the AST, specify the new block.  (I'd
		put all tracking information into the block,
		including the IOSB and the read buffer, etc.)
		Specify the buffer as the $qio ASTPRM arg.

	/*
	//  queue the process request (see the ASTPRM arg) to the
	//  mainline code via an interlocked queue.  (see
	//  lib$insqXX, or the C queue instruction built-ins,
	//  etc.)
	*/
	Enqueue( BusyQ );

	/*
	//  Multiple $wake calls can be made; extra wake requests
	//  are ignored until $hiber.
	*/
	sys$wake()
	return()
	}

:1. Will VMS preempt another process running at same priority
:   when AST is delivered, our PRIORITY_OFFSET sysgen parameter is 0.

   I don't think this is particularly relevent, as I see no shared
   resources here.   (And if you are running at a realtime priority,
   there is no rescheduling until/unless a higher-priority process
   becomes computable.)

:2. Since I am disabling AST delivery in begining how and
:   where VMS would store info about this events?

   There is no need to disable AST delivery here, as having an AST
   active will block reception of other ASTs.

:I had seen a white paper presented at DECUS seminar that
:described how ASTs work on VMS and would have answered my
:quuestion. If it is still around somewhere I would appreciate
:getting a copy.

   There is documentation on AST processing in the OpenVMS Programming
   Concepts manual, as well as in various other manuals in the OpenVMS
   documentation set.  The internals of the AST delivery mechanism are
   documented in the Internals and Data Structures Manual (IDSM).  (And
   the details at the level listed in the IDSM are seldom necessary.)

   I would strongly recommend looking at the DECthreads documentation and
   support, as well.