simple asynchronous remote invocations for distributed real-time java
TRANSCRIPT
Simple Asynchronous Remote Invocations
for Distributed Real-Time Java*
Pablo Basanta-Val, Marisol García-Valls, and Iria Estévez-Ayres
Jornadas de tiempo real 2010- Granada 4 y 5 de febrero de 2010
* Trabajo publicado en IEEE Trans. on Industrial Informatics
Outline
• Context– Synchronous models
• Synchronous remote invocations
– Proposed asynchronous model• Client-side remote invocations• Server-side remote invocations
• Some results• Conclusions and future work
2JTR-2010
Real-time Java in industrial environments
• The use of Java in industrial application is challenging– E.g. garbage collection, byte-code portability
• Giving a well-balanced to these challenges is essential to be have a successful technology– The better the architectonical challenges are
solved, the better infrastructure available
3JTR-2010
Asynchronous communications for distributed real-time Java
• Idea:• “A remote invocation where a client does
not wait for a response of a server”• Ideal for signaling purposes
• Current status:• DRTSJ supports distributed event
– However they are implemented using synchronous remote invocations• CORBA supports the model
– One-way invocations and AMI (Asynchronous Method Invocation)• Solutions well-known in other domains [Volker 06]
– FIRE-AND-FORGET, SYNC-WITH-SERVER, POLL-OBJECT, and RESULT-CALLBACK
• Therefore:• Lets add some [simple] support for [simple] cases in DRT-Java[ FIRE-AND-FORGET, SYNC-WITH-SERVER, RESULT-CALLBACK, and POLL-OBJECT]
4JTR-2010
Current [synchronous] remote invocations
remote objectstub
application
mid_dis_stub_invoke
remote
2 3
5
6
4
7
1
client server
mid_dis_remoteobject_invoke
Exported objects table
7654321
1.. CCCCCCCsyncRI Invocation Rate:
(1→2→3→4→5→6→7)Model:
5
JTR-2010
Client-side asynchronous remote invocations
Invocation Rate:
((1→2→6→7)||(3→4→5)).Model:
remoteobjectstub
application
remote2 3
5
6
4
7
1
client server
mid_dis_stub_invoke
mid_dis_remoteobject_invoke
7621
1.. CCCCasyncclientRI
6JTR-2010
remoteobjectstub
application
remote2 3'
5'’6
4
7
1
client server
3'’
mid_dis_stub_invoke
mid_dis_remoteobject_invoke
5'
Server-side asynchronous remote invocations
Invocation Rate:
((1→2→3’→5’’→6→7)||(3 →4→5’)).′Model:
'''1
53621.. CCCCCasyncserverRI
7JTR-2010
Middleware Specific Extensions
• Language (RMI Spec) issues– Changes in the semantics of a remote exception
( they are not transferred back in async. Invocations)
• New methods required and policies– setAync, getAsync methods– A-A, A-S, S-A and S-S
8JTR-2010
package es.uc3m.it.drequiem.rtrmi.server;import javax.realtime.*;import es.uc3m.it.drequiem.rtrmi.*;import java.rmi.server.RemoteStub;public class RealtimeUnicastRemoteStub { ... public static void setParameters( RemoteStub stub,
boolean async,SchedulingParameters sp,ReleaseParameters rp,MemoryParameters mp,ProcessingGroupParameters pgp,ConnectionPool cpool)
... public static boolean getAsync(RemoteStub stub); public static void setAsync(RemoteStub stub, boolean async);...}
Middleware Specific Extensions
• Changes in the JRMP protocol
• Client and server side implementation diagrams
Message:RtCallCallPingDgcAck
RtCall:0x55 priority noheap mid async oid Call0x55 priority noheap mid async oid Ping0x55 priority noheap mid async oid DgcAck
async:boolean
Result: ProtocolRTAck ProtocolAck #Serv-side synch and synch ProtocolAck null #Client-side asynchProtocolRTAck: 0x55 priority noheap
readAsyncFlag* writeParams+
readResults+
Y
N
asynch==true
*new+extended
readAsyncFlag*readParams+
Y
Y
*new+modified
AA or AS?*
upCall
ACK upCall
upCall
N
N
flag==asynch?*
writeResults+
client-async
server-async
sync invocation
client server
RTCall RTACK
9JTR-2010
DREQUIEMI
JTIME-VM
TimeSys-OS
TCP-IP
Client
796 Mhz
DREQUIEMI
JTIME-VM
TimeSys-OS
TCP-IP
Remoteobject
796 Mhz
Delay (0-2 ms)
Work (0-2 ms)
Data:(-1,0,...100)
Doubles
DRQTracer
EEthereal
net
Protocol: Synch
Sever-side asynch Client-side asynch
Empirical results
• Goals– I.R.sync vs I.R.async
– Client vs server async
• Taking into account • response time, • memory allocated, • bandwidth
10JTR-2010
Memory
Bandwidth Response-time
Best platform results: <0,0,0>
11JTR-2010
Response-time: data,<latency,work>
120
3958
7796 0 1
000
2000
2
3
4
5
6
7
8
N.I.R.
Sent Doublesdelay + work
Client-side Asynch <0-2 ms,0 >, Client-side Asynch <0,0-2 ms >
2-3 3-4 4-5 5-6 6-7 7-8
1
20
3958
7796
01000
2000
1.4
1.6
1.8
2
2.2
2.4
N.I.R.
Sent Doubles
delay
Server-side Asynch <0-2 ms ,0 >
1.4-1.6 1.6-1.8 1.8-2 2-2.2 2.2-2.4
120
3958
7796 0 1000
2000
2
2.5
3
3.5
4
4.5
N.I.R.
Sent Doubles
work
Server-side Asynch <0,0-2 ms >
2-2.5 2.5-3 3-3.5 3.5-4 4-4.5
12JTR-2010
Client vs. Server-side async
1 1121 31 41
51 6171 81
910
1000
2000
1
1.2
1.4
1.6
1.8
Ratio
Sent Doubles
work
N.I.R. client-side/N.I.R. server-side<0,0-2000 us>
1.6-1.8
1.4-1.6
1.2-1.4
1-1.21 11 21 31
41 51 6171 81
910
1000
2000
123
4
5
6
ratio
Sent Doubles
delay
N.I.R. client-side/N.I.R. server-side<0-2000us,0>
5-6
4-5
3-4
2-3
1-2
13JTR-2010
Conclusions and future work
• Analyzed the integration of asynchronism in DRTJava – Changes required not too complex– Client response-time strongly depends on the
[sync, async]remote invocation model used
• Ongoing work– POOL-OBJECT and RESULT-CALLBACK
– IEC-61499 and RTSJ
14JTR-2010