'declare' is concurrent - seems to be a bug!
Peter Van Roy
pvr at info.ucl.ac.be
Tue Oct 12 09:15:13 CEST 2004
Leif Kornstaedt [MSFT] wrote:
>Peter Van Roy <pvr at info.ucl.ac.be> writes:
>
>
>>I just found out something during the first exercise session
>>of my course today: 'declare' is concurrent!
>>[...]
>>I think this is a bug. The only primitive to introduce
>>concurrency should be 'thread'. There is no reason that
>>declaring global variables has to be tied with concurrency;
>>they should be independent concepts.
>>
>>
>
>The Mozart compiler has a switch to control whether "declare"
>is concurrent or not, and the default is "true". Try setting
>
> \switch -threadedqueries
>
>and your example should work as expected. (Otherwise, this is
>really a bug.)
>
> http://www.mozart-oz.org/documentation/compiler/node5.html#label27
>
>The problem with setting threadedqueries to false is that if a
>query does not terminate, your OPI session will hang - forcing
>you to restart the system. (Unless you have a compiler panel
>open, in which case you should be able to interrupt; but I
>haven't tried that functionality in a long time. ;-)
>
>Cheers,
>Leif
>
Ok, with the switch it works. But I am still confused.
There are two issues:
1. Each code fragment fed to the compiler is done so in a separate thread.
2. Each 'declare' statement is concurrent.
It seems to me that if (1) is true, that nonterminating queries are handled
in the way you want. So that (2) can be false without hurting this ability.
So my request is that (2) should be false by default.
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.gforge.info.ucl.ac.be/pipermail/mozart-hackers/attachments/20041012/357afd1c/attachment-0001.html
More information about the mozart-hackers
mailing list