minor mod
[lttv.git] / ltt / branches / poly / doc / developer / lttvwindow_events_delivery.txt
index a3586c0accb76e13e517142dfd777348e1ee7284..c64f9fd5a3032a469968d456d4306d3ed3af33e5 100644 (file)
@@ -141,16 +141,12 @@ Added to the lttvwindow API :
 
 
 void lttvwindow_events_request
-( MainWindow                  *main_win,
-  EventsRequest               *events_request);
-
-void lttvwindow_events_request
-( MainWindow    *main_win,
-  EventsRequest  events_request);
+( Tab                  *tab,
+  const EventsRequest  *events_request);
 
 void lttvwindow_events_request_remove_all
-( MainWindow    *main_win,
-  gpointer       viewer);
+( Tab                *tab,
+  gconstpointer       viewer);
 
 
 Internal functions :
@@ -192,12 +188,51 @@ computation (main window scope) or viewer specific background computation.
 A background computation request is asked via lttvwindow_events_request, with a
 priority field set with a low priority.
 
-If a lttvwindow_events_request_remove_all is done on the viewer pointer, it will
+In the case of a background computation with viewer pointer field set to NULL,
+if a lttvwindow_events_request_remove_all is done on the viewer pointer, it will
 not affect the state computation as no viewer pointer will have been passed in
 the initial request. This is the expected result. For the background processings
 that call viewer's hooks, they will be removed.
 
 
+A New "Redraw" Button
+
+It will be used to redraw the viewers entirely. It is useful to restart the
+servicing after a "stop" action.
+
+A New "Continue" Button
+
+It will tell the viewers to send requests for damaged areas. It is useful to
+complete the servicing after a "stop" action.
+
+
+
+Tab change
+
+If a tab change occurs, we still want to do background processing.
+Events requests must be stocked in a list located in the same scope than the
+traceset context. Right now, this is tab scope. All functions called from the
+request servicing function must _not_ use the current_tab concept, as it may
+change. The idle function must the take a tab, and not the main window, as
+parameter.
+
+If a tab is removed, its associated idle events requests servicing function must
+also be removed.
+
+It now looks a lot more useful to give a Tab* to the viewer instead of a
+MainWindow*, as all the information needed by the viewer is located at the tab
+level. It will diminish the dependance upon the current tab concept.
+
+
+
+Idle function (lttvwindow_process_pending_requests)
+
+The idle function must return FALSE to be removed from the idle functions when
+no more events requests are pending. Otherwise, it returns TRUE. It will service
+requests until there is no more request left.
+
+
+
 
 Implementation
 
@@ -214,7 +249,7 @@ each viewer through process traceset.
 
 - lttvwindow_events_request
 
-It adds the an EventsRequest struct to the array of time requests
+It adds the an EventsRequest struct to the list of events requests
 pending and registers a pending request for the next g_idle if none is
 registered. The viewer can access this structure during the read as its
 hook_data. Only the stop_flag can be changed by the viewer through the
@@ -240,8 +275,8 @@ typedef struct _EventsRequest {
   LttvHooks                   *after_tracefile; /* Unset : NULL             */
   LttvHooks                   *after_trace;     /* Unset : NULL             */
   LttvHooks                   *after_traceset;  /* Unset : NULL             */
-  LttvHooks                   *before_chunk;    /* Unset : NULL             */
-  LttvHooks                   *after_chunk      /* Unset : NULL             */
+  LttvHooks                   *before_request;  /* Unset : NULL             */
+  LttvHooks                   *after_request    /* Unset : NULL             */
 } EventsRequest;
 
 
@@ -251,7 +286,8 @@ typedef struct _EventsRequest {
 It removes all the events requests from the pool that has their "viewer" field
 maching the viewer pointer given in argument.
 
-It calls the traceset/trace/tracefile end hooks for each request removed.
+It calls the traceset/trace/tracefile end hooks for each request removed if
+they are currently serviced.
 
 
 - lttvwindow_process_pending_requests
@@ -268,7 +304,10 @@ calls. Here is the detailed description of the way it works :
 The reads are splitted in chunks. After a chunk is over, we want to check if
 there is a GTK Event pending and execute it. It can add or remove events 
 requests from the event requests list. If it happens, we want to start over
-the algorithm from the beginning.
+the algorithm from the beginning. The after traceset/trace/tracefile hooks are
+called after each interrupted chunk, and before traceset/trace/tracefile are
+called when the request processing resumes. Before and after request hooks are
+called respectively before and after the request processing.
 
 Two levels of priority exists. High priority and low priority. High prio
 requests are serviced first, even if lower priority requests has lower start
@@ -286,7 +325,7 @@ list_in : empty
 list_out : many events requests
 
 
-A. While list_in !empty and list_out !empty and !GTK Event pending
+A. While (list_in !empty or list_out !empty) and !GTK Event pending
   1. If list_in is empty (need a seek)
     1.1 Add requests to list_in
       1.1.1 Find all time requests with the highest priority and lowest start
@@ -307,27 +346,27 @@ A. While list_in !empty and list_out !empty and !GTK Event pending
         - If first req in list_in pos != current pos
           - If the position is the same than the saved state, restore state
           - Else, seek to that position
-    1.3 Add hooks and call begin for all list_in members
+    1.3 Add hooks and call before request for all list_in members
       1.3.1 If !servicing
-          - begin hooks called
+          - begin request hooks called
           - servicing = TRUE
-      1.3.2 call before_chunk
+      1.3.2 call before_traceset
       1.3.3 events hooks added
   2. Else, list_in is not empty, we continue a read
     2.1 For each req of list_out
     - if req.start time == current context time
       - Add to list_in, remove from list_out
       - If !servicing
-        - Call begin
+        - Call begin request
         - servicing = TRUE
-      - Call before_chunk
+      - Call before_traceset
       - events hooks added
     - if req.start position == current position
       - Add to list_in, remove from list_out
       - If !servicing
-        - Call begin
+        - Call begin request
         - servicing = TRUE
-      - Call before_chunk
+      - Call before_traceset
       - events hooks added
 
   3. Find end criterions
@@ -351,32 +390,37 @@ A. While list_in !empty and list_out !empty and !GTK Event pending
   5. After process traceset middle
     - if current context time > traceset.end time
       - For each req in list_in
-        - Call end for req
         - Remove events hooks for req
+        - Call end traceset for req
+        - Call end request for req
         - remove req from list_in
     5.1 For each req in list_in
           - req.num -= count
           - if req.num == 0
-            - Call end for req
             - Remove events hooks for req
+            - Call end traceset for req
+            - Call end request for req
             - remove req from list_in
           - if current context time > req.end time
-            - Call end for req
             - Remove events hooks for req
+            - Call end traceset for req
+            - Call end request for req
             - remove req from list_in
           - if req.end pos == current pos
-            - Call end for req
             - Remove events hooks for req
+            - Call end traceset for req
+            - Call end request for req
             - remove req from list_in
           - if req.stop_flag == TRUE
-            - Call end for req
             - Remove events hooks for req
+            - Call end traceset for req
+            - Call end request for req
             - remove req from list_in
           - if exists one events requests in list_out that has
                   higher priority and time != current time
             - Use current position as start position for req
             - Remove start time from req
-            - Call after_chunk for req
+            - Call after_traceset for req
             - Remove event hooks for req
             - Put req back in list_out, remove from list_in
             - Save current state into saved_state.
@@ -385,7 +429,7 @@ B. When interrupted
   1. for each request in list_in
     1.1. Use current postition as start position
     1.2. Remove start time
-    1.3. Call after_chunk
+    1.3. Call after_traceset
     1.4. Remove event hooks
     1.5. Put it back in list_out
   2. Save current state into saved_state.
@@ -423,7 +467,10 @@ occur often. The solution to it would be to save one state per priority.
 
 Weaknesses
 
-- None (nearly?) :)
+- There is a possibility that we must use seek if more than one interruption
+  occurs, i.e. low priority interrupted by addition of high priority, and then
+  high priority interrupted. The seek will be necessary for the low priority.
+  It could be a good idea to keep one saved_state per priority ?
 
 
 Strengths
This page took 0.025882 seconds and 4 git commands to generate.