Mercurial > hg > FederatedLinda
changeset 112:27874f473d48
modify update()
author | kazz |
---|---|
date | Fri, 27 Aug 2010 22:00:58 +0900 |
parents | 29ed7feebf2a |
children | 4205d029584c |
files | src/fdl/TupleSpace.java src/fdl/test/api/inout/InOutMetaEngine.java src/fdl/test/api/update/UpdateMetaEngine.java |
diffstat | 3 files changed, 18 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fdl/TupleSpace.java Fri Aug 20 21:22:51 2010 +0900 +++ b/src/fdl/TupleSpace.java Fri Aug 27 22:00:58 2010 +0900 @@ -133,9 +133,9 @@ tuple = new Tuple(); tuple.setCommand(PSX.PSX_ANSWER, id, command.getInt(PSX.LINDA_SEQ_OFFSET), ByteBuffer.allocate(0)); } + PSX.send(key, tuple.getCommand(), tuple.getData()); tuple_space[id] = null; Out1(key, command, data, id); - PSX.send(key, tuple.getCommand(), tuple.getData()); } protected void Wait_Rd(SelectionKey key, ByteBuffer command, int mode) {
--- a/src/fdl/test/api/inout/InOutMetaEngine.java Fri Aug 20 21:22:51 2010 +0900 +++ b/src/fdl/test/api/inout/InOutMetaEngine.java Fri Aug 27 22:00:58 2010 +0900 @@ -6,6 +6,7 @@ import fdl.MetaEngine; import fdl.MetaLinda; +import fdl.PSX; import fdl.PSXLinda; import fdl.PSXReply; @@ -39,7 +40,13 @@ if (count >= maxCount) { endTime = new Date(); Long resultTime = new Long(endTime.getTime() - startTime.getTime()); - System.out.println(resultTime); + linda.out(PSX.META_STOP, ByteBuffer.wrap("".getBytes())); + try { + linda.sync(); + } catch (IOException e) { + e.printStackTrace(); + } + System.out.println(maxCount + " " + resultTime); System.exit(0); } if (reply == null) {
--- a/src/fdl/test/api/update/UpdateMetaEngine.java Fri Aug 20 21:22:51 2010 +0900 +++ b/src/fdl/test/api/update/UpdateMetaEngine.java Fri Aug 27 22:00:58 2010 +0900 @@ -6,6 +6,7 @@ import fdl.MetaEngine; import fdl.MetaLinda; +import fdl.PSX; import fdl.PSXLinda; import fdl.PSXReply; @@ -38,8 +39,14 @@ public void mainLoop(MetaLinda ml) { if (count >= maxCount) { endTime = new Date(); - Long resultTime = new Long(endTime.getTime() - startTime.getTime()); - System.out.println(resultTime); + Long resultTime = new Long(endTime.getTime() - startTime.getTime()); + linda.out(PSX.META_STOP, ByteBuffer.wrap("".getBytes())); + try { + linda.sync(); + } catch (IOException e) { + e.printStackTrace(); + } + System.out.println(maxCount + " " + resultTime); System.exit(0); } if (reply == null) {