[comp.os.vms] Number of DECnet processes : how to

reden@sys1.TANDY.COM (06/21/88)

DECNET will create a single network task for each file open at a given time.
Usually, this is just one (two if network output also).  To understand what
happens when you get multiple network tasks, it's necessary to explain what
happens when you start a task...


1. You try to open a remote file, this causes a CONNECT REQUEST to be sent.

2. The remote node sends a CONNECK ACK and starts a network process if there
   isn't one waiting (more on this later).

3. This network process has a lot to do.  (remember how painfull a VMS create
   process is?)  It starts by running LOGINOUT.EXE then SYLOGIN.COM, then  
   LOGIN.COM, then NETSERVER.COM and finally NETSERVER.EXE. 

4. NETSERVER.EXE sends a CONNECT CONFIRM message to the calling process.
   If you've ever gotten a "NETWORK PARTNER EXITED" message (havn't we all)
   chances are there was a problem in #3 and the CONNECT CONFIRM wasn't 
   receive in time.   It could also be the remote system was so bogged down
   that it just didn't finish everything in time.  The wait time can be 
   altered if you run into this problem often.

5. NETSERVER.EXE uses LIB$ calls to transfer control to the proper network
   image (MAIL,PHONE,FAL,NML, etc.)

6. Your local node talks to this process to finish the transaction.

7. When you close your file (using FAL) the FAL.EXE finishes returning control
   back to NETSERVER.COM. 

8. NETSERVER.COM does a number of things to make sure you didn't change your
   privileges or priorities or anything like that (you may not be the one 
   who gets this network process the next time) and then runs NETSERVER.EXE 
   again.

9. NETSERVER.EXE queues a timer with the value stored in the logical name
   NETSERVER$TIMEOUT (usually 5 minutes).  If this times expires then the
   network process is allowed to terminate. (you can change this value to
   keep a process around longer and avoid the long process creation delays)


Now, In answer to your question.  Remember when I said the DECNET checks to
see if there are any network processes available?  That means they have a 
pending read to a mailbox in NETSERVER.EXE.  If you close a file and then
open another one real quick, the process never has time to get through the
NETSERVER.COM DCL (you know how slow DCL is!) and start another read.  If
you try and open another file before NETSERVER.EXE is running, you get another 
process.

Note:  If you're writing a network application, you can actually speed up it's
execution by adding a 5 second delay between a file open and close to allow
the remote network task to cycle.  In most cases a process creation will take
even longer, plus this will save system resources!

In answer to the second question, as to how many.... in most cases 2.  They
will cycle back and forth since the first one should be ready when the 
third open comes in.....


							good luck...

								Robert

k