changeset 67:264123227f0d

large tuple case (suggestion)
author one
date Sat, 06 Jun 2009 14:33:59 +0900
parents 82a292aa41ad
children 1b86f7cfb01a
files src/fdl/PSX.java
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/fdl/PSX.java	Sat Jun 06 14:23:02 2009 +0900
+++ b/src/fdl/PSX.java	Sat Jun 06 14:33:59 2009 +0900
@@ -233,6 +233,14 @@
 			throws IOException {
 		/**
 		 * Receive a command and data according to the command.
+		 * 
+		 * This read could be very large. Since this Linda server is a single
+		 * thread server, large reading is not welcome. In this case, we should
+		 * start another thread for the large reading. If someone access the
+		 * tuple it should be wait for the reading. This makes rather big changes.
+		 * send routines has the same problem also. I think it is better to limit
+		 * basic tuple size, and introduce cascading tuple type.
+		 * We should try it later.
 		 */
 	    receive(channel, command,LINDA_HEADER_SIZE); 
 	    int datalen = command.getInt(LINDA_DATA_LENGTH_OFFSET);
@@ -244,6 +252,9 @@
 	    }
 	    ByteBuffer data = ByteBuffer.allocate(datalen);
 	    data.order(ByteOrder.BIG_ENDIAN);
+//	    if (datalen>SINGLE_THREAD_READ_LIMIT) {
+//	    	... make a thread for reading and mark reading flag
+//	    } else
 	    receive(channel, data, datalen);
 		return data;
 	}