# HG changeset patch # User one # Date 1244266439 -32400 # Node ID 264123227f0d336a2b493aafde75b92ec68b1318 # Parent 82a292aa41ad6d4471797afa8bb90624f6914b1b large tuple case (suggestion) diff -r 82a292aa41ad -r 264123227f0d src/fdl/PSX.java --- 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; }