(j3.2006) LOCK/UNLOCK question

Jim Xia jimxia
Wed Jun 17 13:48:06 EDT 2009


j3-bounces at j3-fortran.org wrote on 06/17/2009 12:27:25 PM:

> Isn't one big difference that lock/unlock isn't a block construct. 
> If I understand
> it right, there's no requirement that the lock and unlock statement be 
in the
> same procedure.  [I don't even think you need an unlock statement.] What 
would
> prevent the optimizer from invoking the procedure with the unlock first? 
 
> 

Short circuit in expression evaluation (such as in IF (f(...) .or. g(...)) 
is another case that a compiler may choose not to evaluate g() at all if 
f() turns to be true.  I think in general it is risky to relax 
restrictions on LOCK/UNLOCK in compound expression when evaluation 
ordering is unclear.  However in some cases, such as recursive procedure 
calls, the order is well defined, and these image control statements can 
be safely used.

Cheers,

Jim Xia

XL Fortran Compiler Test
IBM Toronto Lab at 8200 Warden Ave, Markham, On, L6G 1C7
Phone (905) 413-3444  Tie-line 313-3444
email: jimxia at ca.ibm.com
D2/YF7/8200 /MKM

http://www.ibm.com/software/awdtools/fortran/xlfortran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://j3-fortran.org/pipermail/j3/attachments/20090617/b796b55c/attachment-0001.html 



More information about the J3 mailing list