What after Java? From Objects to Actors 1998

1. Pass

  1. Keywords

  1. Abstract

  1. Introduction

  1. Sections and sub-sections headings

2.Linguistic support for Synchronization

3.Messages and Asynchronous method invocations

4.Resource control

  1. Glance of theoretical foundations

  1. Conclusions

     無い

  1. Known references, authors

        Gul Agha sounds familiar.

        Have read The Java Language Specification

  1. Category

Analysis

  1. Context?

JDK 1.1 (February 19, 1997)

J2SE 1.2 (December 8, 1998)

Related to paper by S. Frølund and G. Agha on Actors Model

  1. What are the assumptions?

 Java concurrency model is not suitable for programming concurrent distributed apps for the internet.

Might not be the most suitable but, certainly is one of the mos used.

App devs have control on thread scheduling. 

we believe that system builders should have the option of selecting fair scheduling if necessary

Thread scheduling is considered JVM’s responsibility but as an option....this have been partially addressed in Java 1.5, see public ReentrantLock(boolean fair)

  1. Do the assumptions appear to be valid? (Correctness)

Some of the aspects of Java treated as drawbacks on the paper are either not necessarily true, or are well know as bad practices, or have improved considerably in recent versions of Java.

The first fragment of code is not a good example of deadlock, if the code would not be synchronized it would simply cause a StackOverflowError.

Also, doesn’t compile, assigning a not assignable...  start() is void, hence can’t be assigned.

Thread t1 = new Thread(a).start();

There is some controversy but is generally accepted that [application] developers shouldn’t rely on the thread scheduler. However, Varela says that developers write libraries to do this!!!!

  Unfortunately, Java provides no mechanism for selecting features of the scheduler, leaving the task of implementing custom scheduling to application developers.  

Bloch, J. 2nd Edition. Effective, Java, Item 72: Don’t depend on the thread scheduler,

  1. What are the paper’s  contributions?

Is an analysis of the Java 1.1 concurrency features. It describes its weakness and contrasts them with the strenges of the actor model.

  1. Is the paper clear?

Comments

Java concurrency has been greatly improved since the paper was written, especially in Java 5 with all the classes in java.util.concurrent. Also now we have Scala that uses the actors model and runs on JVM. Also there are Java framework to work with actors, e.g., Akka

Java 8 vs Scala: a Feature Comparison

 http://www.infoq.com/articles/java-8-vs-scala

C. Varela and G. Agha. What after Java? From Objects to Actors. Computer Networks and ISDN Systems: The International J. of Computer Telecommunications and Networking, 30:573-577, April 1998. Note: Proceedings of the Seventh International Conference on The World Wide Web (WWW7), Brisbane, Australia.   Keyword(s): internet programming languages.

class A implements Runnable{
 B b;
 
synchronized void m() {
   b.n();
 }
 
public void run() { m(); }
}

class B implements Runnable{
 A a;
 
synchronized void n() {
   a.m();
 }
 
public void run() { n(); }
}

class Deadlock {
 
 
public static void main(String[] args){
   A a =
new A();
   B b =
new B();
   a.b = b;
   b.a = a;
   
Thread t1 = new Thread(a);
   
Thread t2 = new Thread(b);
   t1.start();
   t2.start();
 }
   
}