Changes between Version 20 and Version 21 of Java API

Show
Ignore:
Timestamp:
12/03/12 16:21:08 (12 years ago)
Author:
jorisborgdorff
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Java API

    v20 v21  
    347347== Advanced topics == 
    348348 
     349=== Alternative conduit entrances === 
     350 
     351To enhance performance, there are two alternative types of entrances: shared data entrances and asynchronous entrances. The first can be created with 
     352{{{ 
     353public void addPortals() { 
     354   entrance = addSharedDataEntrance("entranceName", double[].class); 
     355} 
     356}}} 
     357When using a shared data entrance, MUSCLE will try to not copy the data that is sent through the conduit. This means that any change that is done by a conduit filter or another submodel that receives the data, also affects the original data. In most cases this is not desirable, since it violates the separation that different submodels have. Moreover, it is fragile since it only works if the sending and receiving submodel are in the same instance, and there is no filter applied that copies the data in some way. 
     358 
     359The shared data conduit entrance does make sense when the sending submodel will not use the sent data in any way, since then another submodels may modify it as it pleases. 
     360 
     361The second alternative conduit entrance is the asynchronous conduit entrance, which is created as 
     362{{{ 
     363   entrance = addAsynchronousEntrance("entranceName", double[].class); 
     364}}} 
     365Whenever a message is sent through this type of entrance the sending submodel does not have to wait until the receiving MUSCLE instance has received the data. This mode of operation slightly increases the latency and involves keeping alive an additional thread. There can be a performance gain if the submodel that sends the data, afterwards immediately continues its computations and does not have to wait for input from another submodel. It may also speed up sending multiple messages shortly after each other. The gain will be larger if data is sent across multiple MUSCLE instances. 
     366 
     367Using the addAsynchronousEntrance call is equivalent to adding the conduit filter "thread" to the beginning of the conduit entrance filter stack, as explained in the [[Configuration|configuration section]].  
    349368=== Dynamic scales === 
    350369