<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem with Temporary Mail Box in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077250#M24960</link>
    <description>[[[One common model for this type of situation is to have the master process (your P1) create a PERMANENT mailbox, with a system wide, well known logical name. The clients create a temporary mailbox then send a message to the master via the permanent mailbox, including the name of their temporary mailbox in the message. The master then opens a channel to the client mailbox and two way communication is established.]]]&lt;BR /&gt;&lt;BR /&gt;The uni-directional mailbox design here is certainly quite typical.&lt;BR /&gt;&lt;BR /&gt;Conversely, permanent mailboxes can often serve as a way to trigger run-time bugs in my experience.  Permanent mailboxes require cleanup, where temporary mailboxes do not.  &lt;BR /&gt;&lt;BR /&gt;I can't think of a recent case where I've chosen to use a permanent mailbox, and I have typically removed such usage out of code I'm maintaining as it can help better deal with failures and restarts.&lt;BR /&gt;&lt;BR /&gt;Mailboxes themselves are not something I'd tend to use in new applications, save for specific cases.  If you're willing to overtly tie into OpenVMS, I'd suggest ICC.  If you're more interested in portability, I'd look to use middleware or IP (IPv4 or IPv6) sockets.&lt;BR /&gt;&lt;BR /&gt;[[[We are also doing the same, might be I am not able to explain it properly. The only difference is that we are not sending the name of temporary mailbox in the message, rather we have defined a logical "TEMP_MAILBOX_&lt;PID&gt;" which will contain the name of temporary mailbox created by process with process id &lt;PID&gt;.]]]&lt;BR /&gt;&lt;BR /&gt;I'd suggest not naming an object (a variable, file, mailbox, etc) for what it is (since any of us can look at same and figure that out), but to name the object for what it is used for, and for what particular application is using it. &lt;BR /&gt;&lt;BR /&gt;Something akin to FOO_CLIENT_pid, for instance, identifies FOO as the application facility associated with the mailbox, and that the mailbox is a client mailbox.  Or FOO_scsnode_CLIENT_pid, if you're working with a cluster-visible object.  Use of the facility also avoids colliding with some other programmer which chose to use the logical name TEMP_MAILBOX_pid, too...&lt;BR /&gt;&lt;BR /&gt;Opinion only, of course.&lt;BR /&gt;&lt;/PID&gt;&lt;/PID&gt;</description>
    <pubDate>Wed, 21 Nov 2007 15:35:29 GMT</pubDate>
    <dc:creator>Hoff</dc:creator>
    <dc:date>2007-11-21T15:35:29Z</dc:date>
    <item>
      <title>Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077234#M24944</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;One process P1 is creating a temporary mail box using a system function SYS$CREMBX.&lt;BR /&gt;&lt;BR /&gt;Second process P2 is trying to establish a connection with temporary mail box created by P1 using system function SYS$ASSIGN, but SYS$ASSIGN function is sometimes returning SS$_IVDEVNAM.&lt;BR /&gt;&lt;BR /&gt;Can anyone help me why SYS$ASSIGN is sometimes returning IVDEVNAM error.&lt;BR /&gt;&lt;BR /&gt;Note: Its a intermittent problem, means most of the times sys$assign is working properly i.e returning SS$_NORMAL and assigning a channel but sometimes (aprox. 1 out of 10) sys$assign is returning IVDEVNAM.&lt;BR /&gt;&lt;BR /&gt;What I know about IVDEVNAM is that, sys$assign will return this value if device i.e. mailbox is no more existing. Can I know what can cause mailbox to be deleted on its own or what could be the other reason that sys$assign is returning IVDEVNAM.&lt;BR /&gt;&lt;BR /&gt;Looking forward for quick help.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;ajaydec</description>
      <pubDate>Wed, 31 Oct 2007 04:54:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077234#M24944</guid>
      <dc:creator />
      <dc:date>2007-10-31T04:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077235#M24945</link>
      <description>&lt;BR /&gt;This is 100% certain to be a programming error&lt;BR /&gt;Typical causes&lt;BR /&gt;&lt;BR /&gt;- mailbox was temporary and creator is already gone.&lt;BR /&gt;- Logical name LNM$TEMPORARY_MAILBOX  not alsways correct.&lt;BR /&gt;- uninitialized (C) variable / buffer overflow&lt;BR /&gt;- hardcoded length restrictions (3 or 4 char mbx name?)&lt;BR /&gt;- creator failed to check error (no mode channels, pool, ...)&lt;BR /&gt;&lt;BR /&gt;When you write 1 out of 10 is that&lt;BR /&gt;- once per day, 1 out of 10 days.&lt;BR /&gt;- several times per minute/hour from one process?&lt;BR /&gt;- all at the same time from multiple processes, some of which fail?&lt;BR /&gt;&lt;BR /&gt;Finally, how does p2 know the name of the mailbox to use? hardcoded logical name?&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.</description>
      <pubDate>Wed, 31 Oct 2007 06:27:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077235#M24945</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-10-31T06:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077236#M24946</link>
      <description>Hi Hein,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;- mailbox was temporary and creator is already gone.&lt;BR /&gt;Creator is not gone, its there&lt;BR /&gt;&lt;BR /&gt;- Logical name LNM$TEMPORARY_MAILBOX not alsways correct.&lt;BR /&gt;I have already make sure LNM$TEMPORARY_MAILBOX logical is always correct.&lt;BR /&gt;&lt;BR /&gt;- uninitialized (C) variable / buffer overflow&lt;BR /&gt;Sorry, I don't understand what you mean by uninitialized (C) variable can you elaborated it, there is no buffer overflow.&lt;BR /&gt;&lt;BR /&gt;- hardcoded length restrictions (3 or 4 char mbx name?)&lt;BR /&gt;There is no hard coded restriction, mbx name can be of any length.&lt;BR /&gt;&lt;BR /&gt;- creator failed to check error (no mode channels, pool, ...)&lt;BR /&gt;Creater check for SS$_NORMAL return value from SYS$CREMBX, if return value is other than SS$_NORMAL, then creator will log the error.&lt;BR /&gt;&lt;BR /&gt;how does p2 know the name of the mailbox to use? hardcoded logical name?&lt;BR /&gt;P2 came to know the mailbox using a logical, its not hardcoded logical, logical value will depend on the mailbox name created by the process p1.&lt;BR /&gt;&lt;BR /&gt;When you write 1 out of 10 is that&lt;BR /&gt;- once per day, 1 out of 10 days.&lt;BR /&gt;- several times per minute/hour from one process?&lt;BR /&gt;- all at the same time from multiple processes, some of which fail?&lt;BR /&gt;&lt;BR /&gt;I'll try to elaborate the situation once again in detail.&lt;BR /&gt;We have a product which start 10 process P1-P10. When we start the product all the 10 process will got started and when we shutdown it, all the 10 process will get shutdown.&lt;BR /&gt;So first of all P1 got started after that P2, P3 and so on.&lt;BR /&gt;P1 is the main process and it will communicate with every other process P2-P10. So, P2-P10 will create a temporary mailbox ( mailbox name will be something like MBA453, MBA454, MBA455 and so on...)&lt;BR /&gt;(don't get confused I am interchanging P1 and P2 from previous)&lt;BR /&gt;Now P1 will try to establish a channel with mailbox created by each and every individual process. But sometimes P1 process is not able to establish channel with mailbox created by P2 or P3 or P4... or P10 and is giving IVDEVNAM error. And most of the times P1 is able to establish channel with each and every mailbox.&lt;BR /&gt;&lt;BR /&gt;Also note:&lt;BR /&gt;1) This problem occurs only on a multiprocessor system. When I run the product on single-processor system, its not giving the IVDEVNAM error.&lt;BR /&gt;2) This problem occurs only during the startup of the product.&lt;BR /&gt;&lt;BR /&gt;Hope I didn't confuse much.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;-ajaydec</description>
      <pubDate>Wed, 31 Oct 2007 07:22:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077236#M24946</guid>
      <dc:creator />
      <dc:date>2007-10-31T07:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077237#M24947</link>
      <description>Ajaydec,&lt;BR /&gt;&lt;BR /&gt;&lt;QUOTE&gt;&lt;BR /&gt;We have a product which start 10 process P1-P10. When we start the product all the 10 process will got started and when we shutdown it, all the 10 process will get shutdown.&lt;BR /&gt;So first of all P1 got started after that P2, P3 and so on.&lt;BR /&gt;P1 is the main process and it will communicate with every other process P2-P10. So, P2-P10 will create a temporary mailbox ( mailbox name will be something like MBA453, MBA454, MBA455 and so on...)&lt;BR /&gt;(don't get confused I am interchanging P1 and P2 from previous)&lt;BR /&gt;Now P1 will try to establish a channel with mailbox created by each and every individual process. But sometimes P1 process is not able to establish channel with mailbox created by P2 or P3 or P4... or P10 and is giving IVDEVNAM error. And most of the times P1 is able to establish channel with each and every mailbox.&lt;BR /&gt;&lt;/QUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Now there's a possibility of mis-synchronisation.&lt;BR /&gt;Are you sure that all processes (P2 thru P10) have created there mailboxes, before process P1 tries to assign channels to them?&lt;BR /&gt;On a multi-CPU system (and even on a single CPU system), P1 might already be trying to assign channels before all other processes have had a change to create the mailboxes.&lt;BR /&gt;&lt;BR /&gt;What are you using for synchronisation?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Kris (aka Qkcl)</description>
      <pubDate>Wed, 31 Oct 2007 07:47:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077237#M24947</guid>
      <dc:creator>Kris Clippeleyr</dc:creator>
      <dc:date>2007-10-31T07:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077238#M24948</link>
      <description>&lt;!--!*#--&gt;Ok much clearler, and as Q says, clearly broken. Just too bad it seemed to work correctly for a while.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Now P1 will try to establish a channel with mailbox created by each and every individual process. &lt;BR /&gt;&lt;BR /&gt;So how does P1 know that its slaves have gotten to the point of creating the mailbox?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; 1) This problem occurs only on a multiprocessor system.&lt;BR /&gt;&lt;BR /&gt;That makes it 100% proof that the application code is broken. Whenever you there is a difference between single CPU and 1 and when running with changed or default priority, the application is broken. Grarantueed. Every time. 1000nds of cases have proven that.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;  When I run the product on single-processor system, its not giving the IVDEVNAM error.&lt;BR /&gt;&lt;BR /&gt;That's just bad luck.&lt;BR /&gt;Do a $SHOW PROC/CONT on P1 and it might break.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; 2) This problem occurs only during the startup of the product.&lt;BR /&gt;&lt;BR /&gt;Of course, because there is a race condition in the startup as described.&lt;BR /&gt;&lt;BR /&gt;Realizing that the MBX is create most of the time, I would suggest a simple retry mechanism, and not to add an eleborat handshake.&lt;BR /&gt;&lt;BR /&gt;Just loop over all slaves.&lt;BR /&gt;If channel assigned, goto next&lt;BR /&gt;Else try assign.&lt;BR /&gt;If none left, done.&lt;BR /&gt;Else wait 10 ms and try again up to 10 times.&lt;BR /&gt;&lt;BR /&gt;todo = SLAVES;&lt;BR /&gt;retry = 10&lt;BR /&gt;while (1) {&lt;BR /&gt;   for (i=0; i&lt;SLAVES&gt;&lt;/SLAVES&gt;      chan = &amp;amp;slave[i]-&amp;gt;chan;&lt;BR /&gt;      if (!*chan) {&lt;BR /&gt;         status = assign &amp;amp;chan ...&lt;BR /&gt;         if (status &amp;amp; 1) {&lt;BR /&gt;            todo--;&lt;BR /&gt;         } else {&lt;BR /&gt;            last_status = status;&lt;BR /&gt;            last_slave = i;&lt;BR /&gt;         }&lt;BR /&gt;       }&lt;BR /&gt;    }&lt;BR /&gt;    if (!todo &amp;amp;&amp;amp; retry--) break;&lt;BR /&gt;    wait_a_while();&lt;BR /&gt;}&lt;BR /&gt;if (todo) {&lt;BR /&gt;  printf STDERR "Failed to assign all channels"...&lt;BR /&gt;:&lt;BR /&gt;return&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;   &lt;BR /&gt;Good luck!&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;         &lt;BR /&gt;&lt;BR /&gt;       &lt;BR /&gt;</description>
      <pubDate>Wed, 31 Oct 2007 08:12:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077238#M24948</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-10-31T08:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077239#M24949</link>
      <description>I'd use locks for process coordination.  For instance, the controlling primary process seeks an exclusive lock the "FOO_I_AM_ALIVE" lock resource and all the servers queue an incompatible lock against this lock.  If a server process is ever granted the lock, it exits.  (The controller is gone, and the servers should go, too.)&lt;BR /&gt;&lt;BR /&gt;I'd look to IP network connections, or maybe to ICC if this is a cluster.  Mailboxes are pretty old design, and -- in general -- I'd not tend to write new code that ties you into OpenVMS platform interfaces if there's an existing and standard API that avoids such.  This means something like IP.  (ICC is most certainly a platform interface, but it lets you operate more easily within a cluster.)&lt;BR /&gt;&lt;BR /&gt;And in general, I'd probably look for and look to use existing process management tools, rather than writing these anew.  For instance, even inetd and cluster aliases and RPC calls or other such can deals with various of the aspects here for you.  Web servers deal with server processes all the time, too, and there are various ways to use web-based servers.&lt;BR /&gt;&lt;BR /&gt;Yeah, I know, you were probably told to use mailboxes by the lead designer or manager.  (Oh, well.)  There's a mailbox demo available  on the Freeware here:&lt;BR /&gt;&lt;A href="http://mvb.saic.com/freeware/freewarev80/hoffman_examples/" target="_blank"&gt;http://mvb.saic.com/freeware/freewarev80/hoffman_examples/&lt;/A&gt;&lt;BR /&gt;See the mbxdemo.* files.&lt;BR /&gt;&lt;BR /&gt;Now if you're going to use these platform APIs, you'll want to use the DECw$Term_Port stuff to allow the created server processes to have a DECterm terminal device associated, or you'll want to start these processes with a WSA device.  In either case, this because it makes it massively more easy to debug code when you can activate the created image with the debugger around, and walk through it.  I'm here inferring that you're not using the debugger now, and this may or may not be a correct inference.  Here's a demo:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://mvb.saic.com/freeware/freewarev80/hoffman_examples/create_decterm.c" target="_blank"&gt;http://mvb.saic.com/freeware/freewarev80/hoffman_examples/create_decterm.c&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Stephen Hoffman&lt;BR /&gt;HoffmanLabs LLC&lt;BR /&gt;</description>
      <pubDate>Wed, 31 Oct 2007 11:04:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077239#M24949</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-10-31T11:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077240#M24950</link>
      <description>One thing I can assure you there is no syncronization error.&lt;BR /&gt;Actually P1 will also create a mailbox (say MBA345), and it will do a sys$qiow to this mailbox.&lt;BR /&gt;&lt;BR /&gt;Now when P2 process has created its mailbox (say MBA346) then it will write the coded value in P1 mailbox(MBA345), since P1 is continuosly reading MBA345 as soon P2 writes into it P1 will read the coded value and it will came to know that it has to establish a channel with mailbox (MBA346) created by P2.&lt;BR /&gt;&lt;BR /&gt;Similarly, P1 process will establish channel with rest of the mailbox created by different process.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;ajadec</description>
      <pubDate>Wed, 31 Oct 2007 13:32:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077240#M24950</guid>
      <dc:creator />
      <dc:date>2007-10-31T13:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077241#M24951</link>
      <description>There have been latent synchronization errors in code that has been heavily used (by all of us!) and particularly in code that has been running without incident for over twenty years.  This in code written that was by some of the best engineers any of us here might know.&lt;BR /&gt;&lt;BR /&gt;That the problem here occurs only on a multiprocessor system makes it almost certain that there one or more synchronization errors latent and lurking here.&lt;BR /&gt;&lt;BR /&gt;Here is a list of some of the more common synchronization bugs that can exist:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/wizard/wiz_1661.html" target="_blank"&gt;http://h71000.www7.hp.com/wizard/wiz_1661.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;SMP and SMT are among the most common triggers for and very commonly expose latent synchronization bugs.  SMP and SMT can and do exercise the application synchronization and related logic to a degree that uniprocessors and single-threaded applications can not even approach.&lt;BR /&gt;&lt;BR /&gt;Fire up the debugger and/or integrate some debugging (or both), and go in for a look.  And do take a look at the sequencing of the mailboxes here.  And yes, the debugger and the introduction of integrated debugging can easily alter the behavior of a latent synchronization bug, or can entirely mask it.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 31 Oct 2007 14:34:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077241#M24951</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-10-31T14:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077242#M24952</link>
      <description>ajaydec,&lt;BR /&gt;&lt;BR /&gt;  Well, I'm confused. I still don't understand how any of these processes know the mailbox name created by other processes. The default for LNM$TEMPORARY_MAILBOX is to place the logical name in LNM$JOB, which means it's only visible to processes in the same job tree. It's not clear in this case how the processes are related. If they're not subprocesses under the same master how are the names exchanged? Has LNM$TEMPORARY_MAILBOX been redefined? &lt;BR /&gt;&lt;BR /&gt;  This gets into a chicken and egg situation, you need a mailbox to communicate between processes, BUT you need to communicate the name of the mailbox. &lt;BR /&gt;&lt;BR /&gt;  Your symptom suggests the step of communicating the mailbox name is broken. It's not clear if you've taken the very obvious step of simply printing out the exact mailbox name you're attempting to open when $ASSIGN returns the IVDEVNAM? If it's via logical name, how do you know it's been defined? If it's a timing issue, try a short delay and retry the $ASSIGN - note this is NOT a recommended "fix", just a way to confirm diagnosis.&lt;BR /&gt;&lt;BR /&gt;  One common model for this type of situation is to have the master process (your P1) create a PERMANENT mailbox, with a system wide, well known logical name. The clients create a temporary mailbox then send a message to the master via the permanent mailbox, including the name of their temporary mailbox in the message. The master then opens a channel to the client mailbox and two way communication is established.</description>
      <pubDate>Wed, 31 Oct 2007 17:39:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077242#M24952</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2007-10-31T17:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077243#M24953</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;One common model for this type of situation is to have the master process (your P1) create a PERMANENT mailbox, with a system wide, well known logical name. The clients create a temporary mailbox then send a message to the master via the permanent mailbox, including the name of their temporary mailbox in the message. The master then opens a channel to the client mailbox and two way communication is established.&lt;BR /&gt;&lt;BR /&gt;We are also doing the same, might be I am not able to explain it properly. The only difference is that we are not sending the name of temporary mailbox in the message, rather we have defined a logical "TEMP_MAILBOX_&lt;PID&gt;" which will contain the name of temporary mailbox created by process with process id &lt;PID&gt;.&lt;BR /&gt;&lt;BR /&gt;So while calling sys$assign, P1 sends "TEMP_MAILBOX_&lt;PID&gt;" as one of its parameter and in return sometimes we are geting IVDEVNAM error.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;ajaydec&lt;/PID&gt;&lt;/PID&gt;&lt;/PID&gt;</description>
      <pubDate>Wed, 31 Oct 2007 18:36:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077243#M24953</guid>
      <dc:creator />
      <dc:date>2007-10-31T18:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077244#M24954</link>
      <description>&amp;gt;&amp;gt; One thing I can assure you there is no syncronization error.&lt;BR /&gt;&lt;BR /&gt;And one thing I can assure you, and I'll put a decent wager on this if you are interested, is that there is! &lt;BR /&gt;There has to be! Otherwise you would not be asking the question right?&lt;BR /&gt;&lt;BR /&gt;Your mindset to solve this problem has to be 'there is a communication / synchronization error here somewhere in this application code. You must assume VMS is doing the right thing, and that the program is doing something wrong somewhere. Maybe error handling, maybe logic, maybe both.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Actually P1 will also create a mailbox (say MBA345), and it will do a sys$qiow to this mailbox.&lt;BR /&gt;Now when P2 process has created its mailbox (say MBA346) then it will write the coded value in P1 mailbox(MBA345), since P1 is continuosly reading &lt;BR /&gt;&lt;BR /&gt;Well duh! Now you tell us! :-).&lt;BR /&gt;That sounds a lot more serious, but not certain. For example, the iosb for the qiow read is not 'double booked' by accident (same variable used for different IO).&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; we are not sending the name of temporary mailbox in the message, rather we have defined a logical "TEMP_MAILBOX_&lt;PID&gt;" which will contain the name of temporary mailbox created by process with process id &lt;PID&gt;.&lt;BR /&gt;&lt;BR /&gt;Why not send the mailbox name? Might as well!&lt;BR /&gt;Why go through the trouble of creating a logical name?&lt;BR /&gt;In what table?&lt;BR /&gt;Could that be failing?&lt;BR /&gt;Mind you.. you don't actually have to send anything special. Just 'Hi!' will do, as the IOSB after the read will contain the PID for the sender.&lt;BR /&gt;&lt;BR /&gt;I would recommend an LNM trace of the process startup:&lt;BR /&gt;$ANALYZE/SYSTEM&lt;BR /&gt;SDA&amp;gt;LNM LOAD ! If not already loaded&lt;BR /&gt;SDA&amp;gt;LNM START TRACE&lt;BR /&gt;SDA&amp;gt;SPAWN "start application"&lt;BR /&gt;SDA&amp;gt;LNM STOP TRACE&lt;BR /&gt;SDA&amp;gt;SET OUTPUT LNM_SHOW_TRACE.LOG&lt;BR /&gt;SDA&amp;gt;LNM SHOW TRACE&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PID&gt;&lt;/PID&gt;</description>
      <pubDate>Wed, 31 Oct 2007 18:56:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077244#M24954</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-10-31T18:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077245#M24955</link>
      <description>Process P2-P10 will write to P1 mailbox as follows using sys$qiow:&lt;BR /&gt;&lt;BR /&gt;status = SYS$QIOW( 0,channel,code,&amp;amp;iosb,0,0,buffer,buf_size,0,0,0,0 );&lt;BR /&gt;&lt;BR /&gt;where:&lt;BR /&gt;&lt;BR /&gt;channel is the channel no. assigned with the P1 mailbox.&lt;BR /&gt;code is IO$_WRITEVBLK | IO$M_NOW&lt;BR /&gt;buffer = ""&lt;BR /&gt;buf_size = 164.&lt;BR /&gt;&lt;BR /&gt;Process P1 is reading the mailbox as follows:&lt;BR /&gt;&lt;BR /&gt;qiow_status = sys$qiow(efn_flg, DECEDI$DS_CB_REMOTE.ds_mbx_channel_in,      IO$_READVBLK,&amp;amp;iosb_blk,0,0,&amp;amp;dsr,sizeof(dsr),0,0,0,0);&lt;BR /&gt;&lt;BR /&gt;where:&lt;BR /&gt;&lt;BR /&gt;efn_flg value is obtain as follows:&lt;BR /&gt;&lt;BR /&gt;LIB$GET_EF ( &amp;amp;efn_flg );&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;ajaydec</description>
      <pubDate>Wed, 31 Oct 2007 19:59:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077245#M24955</guid>
      <dc:creator />
      <dc:date>2007-10-31T19:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077246#M24956</link>
      <description>This does sound like a design flaw in the application. It's a classic example of one of the problems that commonly occurs when moving code from a uniprocessor environment to a multiprocessor environment. The introduction of parallelism often exposes design flaws in the state machine. I've had it happen to me with code that "worked perfectly" for over 7 years, then promptly blew up when we tested it on a multiprocessor environment. I'd failed to correctly guard against a race condition that I'd not considered as the implicit assumption was that things would happen in the correct sequence. That's not always true in a multiprocessor environment.&lt;BR /&gt;&lt;BR /&gt;Please look closely at the way in which you both synchronise and serialise access to the mailbox during the startup sequence. It's not enough to do one thing at once, your code also has to do the right thing in the right order. The lock manager is the mechanism you want to be using to implement the serialisation and synchronisation mechanisms. Don't "roll your own" with flag bits.&lt;BR /&gt;&lt;BR /&gt;As for inter-process communication - if it's only a small amount of data to be passed around, consider using the extended lock value block. If it's a lot of data shared between the processes, consider using a global section and having sufficiently fine granularity of the data structures protected by locks so as to minimise wait states. Don't forget about termination mailboxes either.&lt;BR /&gt;&lt;BR /&gt;Have fun.&lt;BR /&gt;&lt;BR /&gt;Cheers, Colin (&lt;A href="http://www.xdelta.co.uk)." target="_blank"&gt;http://www.xdelta.co.uk).&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Nov 2007 04:11:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077246#M24956</guid>
      <dc:creator>Colin Butcher</dc:creator>
      <dc:date>2007-11-01T04:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077247#M24957</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;Thanks for your help and time, but still I am not able to get it right. I'll again try to explain the process in detail:&lt;BR /&gt;&lt;BR /&gt;1) P1 process will start and it will create permanent mailbox and will read it as follows:&lt;BR /&gt;&lt;BR /&gt;qiow_status = sys$qiow(efn_flg, DECEDI$DS_CB_REMOTE.ds_mbx_channel_in, IO$_READVBLK,&amp;amp;iosb_blk,0,0,&amp;amp;dsr,sizeof(dsr),0,0,0,0);&lt;BR /&gt;&lt;BR /&gt;where:&lt;BR /&gt;&lt;BR /&gt;efn_flg value is obtain as follows:&lt;BR /&gt;&lt;BR /&gt;LIB$GET_EF ( &amp;amp;efn_flg );&lt;BR /&gt;&lt;BR /&gt;2) P2-P10 process is being created and each process does the following:&lt;BR /&gt;&lt;BR /&gt; i) Assign a channel to mailbox created by process P1 using sys$assign.&lt;BR /&gt; ii) Create a temporary mailbox.&lt;BR /&gt;&lt;BR /&gt;  status1 = SYS$CREMBX( 0, channel, msg_size, 0, 0, 0, &amp;amp;mbx_log_name );&lt;BR /&gt;&lt;BR /&gt;  where:&lt;BR /&gt;  mbx_log_name is logical to temporary mailbox name&lt;BR /&gt; iii) pings/writes to the mailbox created by P1 as follows:&lt;BR /&gt;  status = SYS$QIOW( 0,channel,code,&amp;amp;iosb,0,0,buffer,buf_size,0,0,0,0 );&lt;BR /&gt;&lt;BR /&gt;  where:&lt;BR /&gt;&lt;BR /&gt;  channel is the channel no. assigned with the P1 mailbox.&lt;BR /&gt;  code is IO$_WRITEVBLK | IO$M_NOW&lt;BR /&gt;  buffer = ""&lt;BR /&gt;  buf_size = 164.&lt;BR /&gt; iv) After this waits for process P1 to write in its temporary mailbox as follows:&lt;BR /&gt;  status = SYS$QIOW(efn_flag,io_channel_in,IO$_READVBLK,0,0,0,&amp;amp;P1_reply,sizeof(P1_reply),0,0,0,0);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;3) Once Process P2-P10 writes in mailbox of process P1, process P1 will assign a channel to temporary mailbox of process P2-P10. Temporary mail box name will be defined in logical tmp_mbx_name_&lt;PROCESS_ID&gt;, where process_id is the process id of the process P2-P10.&lt;BR /&gt;&lt;BR /&gt;Could anyone help me to know where, syncronization and parallelism is lacking because of which sometimes, I am getting IVDEVNAM error by process P1 when it is trying to assign a channel to temporary mailbox created by process P2-P10.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;ajaydec&lt;/PROCESS_ID&gt;</description>
      <pubDate>Wed, 21 Nov 2007 09:00:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077247#M24957</guid>
      <dc:creator />
      <dc:date>2007-11-21T09:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077248#M24958</link>
      <description>ajaydec,&lt;BR /&gt;&lt;BR /&gt;I agree with Hein, Hoff, Colin, et al that this is a synchronization error. The IVDEVNAM error can occur for any number of reasons, not necessarily only the obvious ones.&lt;BR /&gt;&lt;BR /&gt;Personally, I prefer to chase these problems analytically, not by gathering a lot of data, which, in the end, will not be helpful. However, if one wishes to exclude some possibilities, one can collect the names of the devices being used by the ASSIGN call in a separate array, and then look at the array with the debugger. DO NOT use printf statements, as the extra time has a good chance of disrupting the timing behavior.&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Nov 2007 09:36:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077248#M24958</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2007-11-21T09:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077249#M24959</link>
      <description>So far I don't see a coding problem except that:&lt;BR /&gt;&lt;BR /&gt;"iv) After this waits for process P1 to write in its temporary mailbox as follows:&lt;BR /&gt;status = SYS$QIOW(efn_flag,io_channel_in,IO$_READVBLK,0,0,0,&amp;amp;P1_reply,sizeof(P1_reply),0,0,0,0);"&lt;BR /&gt;&lt;BR /&gt;...is not using an IOSB.&lt;BR /&gt;&lt;BR /&gt;Here is what the book says about $ASSIGN and INVDEVNAM:&lt;BR /&gt;&lt;BR /&gt;"No device name was specified, the logical name translation failed, or the device or mailbox name string contains invalid characters."&lt;BR /&gt;&lt;BR /&gt;To get more information I would output/log  the translation of the logical used in the $ASSIGN. My bet is that the transmission and/or handling of the logical name has a problem.&lt;BR /&gt;&lt;BR /&gt;I don't see a synchronization problem.&lt;BR /&gt;&lt;BR /&gt;/Guenther</description>
      <pubDate>Wed, 21 Nov 2007 15:18:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077249#M24959</guid>
      <dc:creator>Guenther Froehlin</dc:creator>
      <dc:date>2007-11-21T15:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077250#M24960</link>
      <description>[[[One common model for this type of situation is to have the master process (your P1) create a PERMANENT mailbox, with a system wide, well known logical name. The clients create a temporary mailbox then send a message to the master via the permanent mailbox, including the name of their temporary mailbox in the message. The master then opens a channel to the client mailbox and two way communication is established.]]]&lt;BR /&gt;&lt;BR /&gt;The uni-directional mailbox design here is certainly quite typical.&lt;BR /&gt;&lt;BR /&gt;Conversely, permanent mailboxes can often serve as a way to trigger run-time bugs in my experience.  Permanent mailboxes require cleanup, where temporary mailboxes do not.  &lt;BR /&gt;&lt;BR /&gt;I can't think of a recent case where I've chosen to use a permanent mailbox, and I have typically removed such usage out of code I'm maintaining as it can help better deal with failures and restarts.&lt;BR /&gt;&lt;BR /&gt;Mailboxes themselves are not something I'd tend to use in new applications, save for specific cases.  If you're willing to overtly tie into OpenVMS, I'd suggest ICC.  If you're more interested in portability, I'd look to use middleware or IP (IPv4 or IPv6) sockets.&lt;BR /&gt;&lt;BR /&gt;[[[We are also doing the same, might be I am not able to explain it properly. The only difference is that we are not sending the name of temporary mailbox in the message, rather we have defined a logical "TEMP_MAILBOX_&lt;PID&gt;" which will contain the name of temporary mailbox created by process with process id &lt;PID&gt;.]]]&lt;BR /&gt;&lt;BR /&gt;I'd suggest not naming an object (a variable, file, mailbox, etc) for what it is (since any of us can look at same and figure that out), but to name the object for what it is used for, and for what particular application is using it. &lt;BR /&gt;&lt;BR /&gt;Something akin to FOO_CLIENT_pid, for instance, identifies FOO as the application facility associated with the mailbox, and that the mailbox is a client mailbox.  Or FOO_scsnode_CLIENT_pid, if you're working with a cluster-visible object.  Use of the facility also avoids colliding with some other programmer which chose to use the logical name TEMP_MAILBOX_pid, too...&lt;BR /&gt;&lt;BR /&gt;Opinion only, of course.&lt;BR /&gt;&lt;/PID&gt;&lt;/PID&gt;</description>
      <pubDate>Wed, 21 Nov 2007 15:35:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077250#M24960</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-11-21T15:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077251#M24961</link>
      <description>&lt;!--!*#--&gt;maybe consider setting things up such &lt;BR /&gt;the the temporary mailbox logicals (names)&lt;BR /&gt;are entered in a group logical table?&lt;BR /&gt;&lt;BR /&gt;iirc, this was (or similar to) the VMS 3.x&lt;BR /&gt;behavior. &lt;BR /&gt;&lt;BR /&gt;we had some old code (mid/late 1980's) that required this behavior, but there might well be some larger (newer) reasons why this would *not* be good idea in the general case. &lt;BR /&gt;&lt;BR /&gt;$ DEFINE/TABLE=LNM$PROCESS_DIRECTORY -LNM$TEMPORARY_MAILBOX LNM$GROUP&lt;BR /&gt;&lt;BR /&gt;..or (approximately):&lt;BR /&gt;&lt;BR /&gt;   l_sts = lib$set_logical(&lt;BR /&gt;        $DESCR("LNM$TEMPORARY_MAILBOX"),&lt;BR /&gt;        $DESCR2("LNM$GROUP"),&lt;BR /&gt;        $DESCRL("LNM$PROCESS_DIRECTORY"),&lt;BR /&gt;        0, 0);&lt;BR /&gt;</description>
      <pubDate>Sat, 08 Dec 2007 23:08:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077251#M24961</guid>
      <dc:creator>Larry Bohan</dc:creator>
      <dc:date>2007-12-08T23:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077252#M24962</link>
      <description>@Larry,&lt;BR /&gt;&lt;BR /&gt;Just be aware that ANYBODY _WRITING_ anything in that mailbox now requires GRPNAM privilege!&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Sun, 09 Dec 2007 10:43:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077252#M24962</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2007-12-09T10:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Temporary Mail Box</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077253#M24963</link>
      <description>[[[Just be aware that ANYBODY _WRITING_ anything in that mailbox now requires GRPNAM privilege!]]]&lt;BR /&gt;&lt;BR /&gt;Privileges are initially checked when an object (file, device, mailbox, logical name table, queue, etc) is access (or created), and not generally checked (again) at run-time as the channel is accessed.  (Yes, there are specific operations that might involve extra checks -- tossing an IO$_DIAGNOSE function at the device, for instance -- but these are not typical).  &lt;BR /&gt;&lt;BR /&gt;And a programmer can set a group mailbox to any protection that might be required.  (The associated logical name goes in the group table and grpnam can be (is) required there, but the mailbox itself has its own and separate protection.)&lt;BR /&gt;&lt;BR /&gt;And if you're so inclined, you can reconfigure the group logical name table protection for a table, as these tables are also security objects and have ownership, protections and ACL capabilities.&lt;BR /&gt;&lt;BR /&gt;Further, programmers will generally want to confirm the mailbox device ownership and the device protection are as expected, and any ACL that might be associated with the device.  (Mailboxes are an ideal site for injecting messages into an environment; there can be security implications of a security-critical environment.  This traffic can potentially require protection.)&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 09 Dec 2007 18:45:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-with-temporary-mail-box/m-p/5077253#M24963</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-12-09T18:45:15Z</dc:date>
    </item>
  </channel>
</rss>

