Wouldn't the HL7 link monitor be an example of this?  The background
processes write something about their state to a global and some other
process monitors the global and displays it.  Depending on how precise you
need to be, you could use $J as a subscript and you won't need to lock.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gregory
Woodhouse
Sent: Tuesday, January 17, 2006 9:50 AM
To: hardhats-members@lists.sourceforge.net
Subject: Re: [Hardhats-members] Interleaving


On Jan 15, 2006, at 7:03 PM, Gregory Woodhouse wrote:

>
> On Jan 15, 2006, at 4:28 PM, Kevin Toppenberg wrote:
>
>> How about writing to a global:
>>
>> +L set ^GLOBAL(^GLOBAL(0))=VALUE,^GLOBAL(0)=^GLOBAL(0)+1 -L
>>
>> Kevin
>
> That won't work (because of the lock). What I'd like to do is, in  
> some sense, the opposite of what you usually want to do with  
> concurrent processes. You generally, define critical sections in  
> your code (using locks or a similar construct) to prevent  
> interference from other concurrent processes, but I want to make  
> the interference visible, and the more dramatically the better.
>

I think Kevin is the only one to offer a solution.  I hadn't thought  
of it when I replied here, but his solution can be made to work using  
$INCREMENT

S ^GLOBAL=0


J1      ;
  F I=1:1:100 S ^GLOBAL($INCREMENT(^GLOBAL))="A"
  Q
J2      ;
  F I=1:1:100 S ^GLOBAL($INCREMENT(^GLOBAL))="B"
  Q

I still can't think of any way to do it in Standard MUMPS.

===
Gregory Woodhouse
[EMAIL PROTECTED]

"The whole of science is nothing more than a refinement of everyday  
thinking."
  -- Albert Einstein





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hardhats-members



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to