Basic HTML version of Foils prepared May 19 99

Foil 20 Synchronization - Example

From Elements of Concurrent Programming in Java Tango Group Internal Technology Seminars -- Spring 99. by Lukasz Beca


1 public class LinkedCell {
2 protected double value_; // mutable
3 protected LinkedCell next_; // immutable
4 public LinkedCell(double v, LinkedCell t) {
5 value_ = v;
6 next_ = t;
7 }
8 public synchronized double value() {
9 return value_;
10 }
11 public synchronized void setValue(double v) {
12 value_ = v;
13 }

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Wed May 19 1999