You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by mb...@apache.org on 2017/01/25 15:23:18 UTC

incubator-systemml git commit: [SYSTEMML-1196] Fix bufferpool robustness (flag visibility)

Repository: incubator-systemml
Updated Branches:
  refs/heads/master 115d90639 -> 61b365820


[SYSTEMML-1196] Fix bufferpool robustness (flag visibility)

Our bufferpool serializes matrices and frames outside a synchronized
region in order to keep the serial fraction as small as possible. Since
one thread blocks until another thread updates a certain flag, we now
ensure - via volatile - that these updates are always visible.  

Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/61b36582
Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/61b36582
Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/61b36582

Branch: refs/heads/master
Commit: 61b36582002e44ddc2c6555e1c393eabb942cc24
Parents: 115d906
Author: Matthias Boehm <mb...@gmail.com>
Authored: Wed Jan 25 16:18:22 2017 +0100
Committer: Matthias Boehm <mb...@gmail.com>
Committed: Wed Jan 25 16:18:38 2017 +0100

----------------------------------------------------------------------
 .../sysml/runtime/controlprogram/caching/ByteBuffer.java     | 8 ++++----
 .../runtime/controlprogram/caching/LazyWriteBuffer.java      | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/61b36582/src/main/java/org/apache/sysml/runtime/controlprogram/caching/ByteBuffer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/ByteBuffer.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/ByteBuffer.java
index a24dff3..807fdc4 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/ByteBuffer.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/ByteBuffer.java
@@ -36,10 +36,10 @@ import org.apache.sysml.runtime.util.LocalFileUtils;
  */
 public class ByteBuffer
 {
-	private boolean _serialized;	
-	private boolean _shallow;
-	private boolean _matrix;
-	private long _size;
+	private volatile boolean _serialized;	
+	private volatile boolean _shallow;
+	private volatile boolean _matrix;
+	private final long _size;
 	
 	protected byte[]     _bdata = null; //sparse matrix
 	protected CacheBlock _cdata = null; //dense matrix/frame

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/61b36582/src/main/java/org/apache/sysml/runtime/controlprogram/caching/LazyWriteBuffer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/LazyWriteBuffer.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/LazyWriteBuffer.java
index 3447727..a230d7b 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/LazyWriteBuffer.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/LazyWriteBuffer.java
@@ -38,7 +38,7 @@ public class LazyWriteBuffer
 	}
 	
 	//global size limit in bytes
-	private static long _limit; 
+	private static final long _limit; 
 	
 	//current size in bytes
 	private static long _size;