(j3.2006) LOCK/UNLOCK question
Bill Long
longb
Wed Jun 17 14:07:31 EDT 2009
It is possible to have a clue-limited programmer who would put a lock in
one function and an unlock for the same variable in a different
function, and then write a statement that executes both functions.
However, it is also possible (and more likely) for a programmer to write
a function with both the lock and unlock, in the right order, and
serving a useful purpose.
I'd lean towards letting the second programmer do the useful thing at
the expense of having to tell the first programmer that he has written a
badly designed program.
Cheers,
Bill
dick.hendrickson at att.net wrote:
>
>
> 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?
>
> Dick Hendrickson
>
>
--
Bill Long longb at cray.com
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120
More information about the J3
mailing list