[concurrency-interest] An article example

Szabolcs Ferenczi szabolcs.ferenczi at gmail.com
Mon Apr 30 17:12:19 EDT 2007


On 30/04/07, Alexandru Popescu ☀ <the.mindstorm.mailinglist at gmail.com> wrote:
> On 4/30/07, David Holmes <dcholmes at optusnet.com.au> wrote:

> > They code the wait() in an "if" , instead of a "while" loop.

This is a mistake that will be made by a lot of people, I am afraid.

On the occasion of this mistake let me have a remark: This indicates
that the Java programming language is not a genuine multi-threaded
language. Unfortunately it does not have proper language means for
dealing with concurrency.

It adapted some form of the monitor construction but unfortunately the
most primitive form. It is something that was proposed by Horare for
operating systems in '72 (http://www.acm.org/classics/feb96/). At the
same time there was a alternative proposal by Per Brinch Hansen
(http://brinch-hansen.net/papers/1973b.pdf), which was at a bit higher
level. In the latter proposal the language primitive for long term
scheduling was

await(condition)

meaning that the thread is suspended until the condition holds. No
question whether it should be applied in an 'if' branch or in a
'while' loop. After all, the 'if' and the 'while' commands are
designed for sequential programming.

However, the best choice could be if a multi-threaded programming
language would take over and adapt the Guarded Commands
(http://www.cs.utexas.edu/users/EWD/ewd04xx/EWD418.PDF) which was
designed to cope with indeterminacy at the language level.

Perhaps Java could be improved with respect to concurrency.

Now, before the Java wrestler guys start to attack me again or to
command me to read some more literature on this subject, let me repeat
that it was only a humble remark. No attack, please.

On the other hand, comments and arguments are welcome. I am open to discussion.

Best Regards,
Szabolcs



More information about the Concurrency-interest mailing list