--- Steven McPhelan <[EMAIL PROTECTED]> wrote:

> Your increment example would show the interleave by looking at the
> subscripted global.  Why not do this as:
> 
> S ^GLB=""
> 
> J1 ;
>     F I=1:1:100 S ^GLB=$G(^GLB)_"A"
>     Q
> 
> 
> 
> J2 ;
>     F I=1:1:100 S ^GLB=$G(^GLB)_"B"
>     Q
> 
> 
> Wouldn't that show interleaving within standard M without using the
> explicit
> LOCK command.  

The problem here is that reading ^GLB and updating it are separate
operations, meaning one process could overwrite the output of the
other. For example, J1 could read ^GLB and find "BBA". J2 could add a
"B" making it "BBAB", but when J1 does its set that value is lost, and
it becomes "BBAA".

===
Gregory Woodhouse  <[EMAIL PROTECTED]>
"All truth passes through three stages: First, it is ridiculed.
Second, it is violently opposed. Third, it is accepted as
being self-evident."
--Arthur Schopenhauer


-------------------------------------------------------
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