Revised prefetch notes
authoradash <adash>
Tue, 26 Jun 2007 03:02:50 +0000 (03:02 +0000)
committeradash <adash>
Tue, 26 Jun 2007 03:02:50 +0000 (03:02 +0000)
added new data structure

Robust/src/Runtime/DSTM/docs/prefetchnotes
Robust/src/Runtime/DSTM/interface/dstm.h

index 06b4742dd862916823372729ec44bca8b518bfda..1c90595fdaf2dc166538f4aff95d8020e1626511 100644 (file)
@@ -13,9 +13,10 @@ x.y.r.t
 x[i].z
 ((Integer) x).z
 
-Max no of prefetch objects  = #DEFINE 20
 control = 1 byte, oid = 4 bytes, new oid = 4 bytes,  depth = 1/ 2 bytes, name/type = 2 bytes, offset = 2 bytes, index = 2 bytes, typecastcheck = 2 bytes, 
 
+       new oid = The oid found at the Participant side that can be sent to Coordinator sending prefetch message
+
 Assumptions
 ===========
 
@@ -26,9 +27,11 @@ Assumptions
 Procedure:
 1. Compiler identifies which oids and oids.offset field to prefetch(analysing the C code)
 and supplies that information to the Coordinator machine wanting to commit transaction.
-       Q: How does compiler convey this to a machine?
-2. Machine distinguishes and classifies objects as "shared" or "unique"
+       Q: How does compiler convey this to a machine? (Design compiler interface)
+
+2. Machine distinguishes and classifies tuples as "shared" or "unique"
        e.g. while prefetching x.y.z and a.y.z  if variable x == a then considered shared else unique
+       also consider the case of x.y.z and a.y.z.t  where x == a ( Then prefetch only a.y.z.t)
 3. If not available in local machine, look up location table and make piles to send 
    prefetch control messages to all the Particpant machines from which prefetch is required.
 4. Iteratively look up the data field of the objects at the Particpant side to find objects
@@ -38,21 +41,21 @@ and supplies that information to the Coordinator machine wanting to commit trans
                
 Coordinator messages:
 
-<TRANS_PREFETCH  - control, participant machine id + tid, number of prefetch tuples, tuples of { size of each tuple, oids, offsets/index/typecastcheck, type1, offset2 , type2 .....end of chain symbol}
+<TRANS_PREFETCH  - control, participant machine id + tid, tuples of {oids, offsets/index/typecastcheck, offset2,  .....end of chain symbol}, one special
+oid to indicate end of TRANS_PREFETCH
 e.g of tuple for x.y.z
-{ size of tuple(how many bytes is the tuple message), depth of the tuple = 3, oid "x", # of bytes of offset "x", # of array index "x" (in this case is -1), name/type of "y", # of bytes of offset "y",
- # of array index "y" = -1, name/type of "z", #of bytes of offset "z" (in this case =0), # of bytes of array index "z" = -1 }
+{ depth of the tuple = 3, oid "x", # of bytes of offset "x", # of array index "x" (in this case is -1),  # of bytes of offset "y",
+ # of array index "y" = -1, #of bytes of offset "z" (in this case = -1 to mark  special character for end of tuple), # of bytes of array index "z" = -1}
                
 
 Participant messages:
 
-<TRANS_PREFETCH_RESPONSE - control, number of tuples for which oid's found, tuples of{oids, offsets, found oid}, number of tuples for which oids not found, tuples of {
-       oids, offsets, oids not found }
-e.g. of tuple for x.y.z 
-{ size of tuple, depth of tuple = 3, oid, name/ type of "y", new oid, name/type of "z", new oid } if new oid == 0 or -1 => obj not found 
-
+<TRANS_PREFETCH_RESPONSE - control,tuples of{oids, object header + object)
+e.g. of tuple for x.y.z  where x and y are found but z is not found
+{{oid of x, 0 , object header + obj x, special character}, {oid of x , oid of y, object header + obj y, special character},{
+       oid x, oid of z, NULL, special character}}  
 Q: How can we represent offset, or index or typechecking .....in bytes i.e. short type number?
-
+TODO : handle the NULL cases here
 
        
 
index 1ec1b440f1f0c92ef4d486df509dfd1ea9671e6b..f13a28a4e8f2af00a7e48c4075782c26b8188233 100644 (file)
@@ -13,6 +13,7 @@
 #define        TRANS_REQUEST           5
 #define        TRANS_ABORT             6
 #define TRANS_COMMIT           7
+#define TRANS_PREFETCH         8
 #define TRANS_ABORT_BUT_RETRY_COMMIT_WITH_RELOCATING   9
 
 //Participant Messages
@@ -121,6 +122,22 @@ typedef struct trans_commit_data{
        int numlocked;
        int numnotfound;
 }trans_commit_data_t;
+
+//Structure for prefetching tuples generated by teh compiler
+ typedef struct trans_prefetchtuple{
+        unsigned int depth;
+        unsigned int oid;
+        trans_member_t member;
+        struct trans_prefetchtuple *next;
+ }trans_prefetchtuple_t;
+
+//Structure for members within prefetch tuples
+typedef struct member {
+        short offset;
+        short index;
+        struct member *next;
+ }trans_member_t;
+
 /* Initialize main object store and lookup tables, start server thread. */
 int dstmInit(void);